Skip to content

Commit

Permalink
Remove non-jsonb backend from Lookout (#3577)
Browse files Browse the repository at this point in the history
  • Loading branch information
zuqq committed May 10, 2024
1 parent c89276a commit 1136035
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 1,726 deletions.
18 changes: 4 additions & 14 deletions internal/lookoutv2/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ func Serve(configuration configuration.LookoutV2Config) error {
return err
}

getJobsRepo := repository.NewSqlGetJobsRepository(db, false)
getJobsJsonbRepo := repository.NewSqlGetJobsRepository(db, true)
groupJobsRepo := repository.NewSqlGroupJobsRepository(db, false)
groupJobsJsonbRepo := repository.NewSqlGroupJobsRepository(db, true)
getJobsRepo := repository.NewSqlGetJobsRepository(db)
groupJobsRepo := repository.NewSqlGroupJobsRepository(db)
decompressor := compress.NewThreadSafeZlibDecompressor()
getJobRunErrorRepo := repository.NewSqlGetJobRunErrorRepository(db, decompressor)
getJobSpecRepo := repository.NewSqlGetJobSpecRepository(db, decompressor)
Expand All @@ -56,11 +54,7 @@ func Serve(configuration configuration.LookoutV2Config) error {
func(params operations.GetJobsParams) middleware.Responder {
filters := slices.Map(params.GetJobsRequest.Filters, conversions.FromSwaggerFilter)
order := conversions.FromSwaggerOrder(params.GetJobsRequest.Order)
repo := getJobsRepo
if backend := params.Backend; backend != nil && *backend == "jsonb" {
repo = getJobsJsonbRepo
}
result, err := repo.GetJobs(
result, err := getJobsRepo.GetJobs(
armadacontext.New(params.HTTPRequest.Context(), logger),
filters,
params.GetJobsRequest.ActiveJobSets,
Expand All @@ -81,11 +75,7 @@ func Serve(configuration configuration.LookoutV2Config) error {
func(params operations.GroupJobsParams) middleware.Responder {
filters := slices.Map(params.GroupJobsRequest.Filters, conversions.FromSwaggerFilter)
order := conversions.FromSwaggerOrder(params.GroupJobsRequest.Order)
repo := groupJobsRepo
if backend := params.Backend; backend != nil && *backend == "jsonb" {
repo = groupJobsJsonbRepo
}
result, err := repo.GroupBy(
result, err := groupJobsRepo.GroupBy(
armadacontext.New(params.HTTPRequest.Context(), logger),
filters,
params.GroupJobsRequest.ActiveJobSets,
Expand Down
68 changes: 0 additions & 68 deletions internal/lookoutv2/repository/frombuilder.go

This file was deleted.

32 changes: 0 additions & 32 deletions internal/lookoutv2/repository/frombuilder_test.go

This file was deleted.

Loading

0 comments on commit 1136035

Please sign in to comment.