Skip to content

Commit 0e55378

Browse files
committed
add query param and fix interval
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
1 parent 3acf2ac commit 0e55378

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

app/controlplane/cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func main() {
170170
// Start the background CAS Backend checker
171171
// TODO: Make it configurable from the application config
172172
if app.casBackendChecker != nil {
173-
go app.casBackendChecker.Start(ctx, &biz.CASBackendCheckerOpts{CheckInterval: 1 * time.Minute, OnlyDefaults: true})
173+
go app.casBackendChecker.Start(ctx, &biz.CASBackendCheckerOpts{CheckInterval: 30 * time.Minute, OnlyDefaults: true})
174174
}
175175

176176
// start and wait for stop signal

app/controlplane/pkg/data/casbackend.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,14 @@ func (r *CASBackendRepo) UpdateValidationStatus(ctx context.Context, id uuid.UUI
235235
// ListBackends returns CAS backends across all organizations. Only not inline backends are returned
236236
// If onlyDefaults is true, only default backends are returned
237237
func (r *CASBackendRepo) ListBackends(ctx context.Context, onlyDefaults bool) ([]*biz.CASBackend, error) {
238-
query := r.data.DB.CASBackend.Query().WithOrganization().
239-
Where(casbackend.DeletedAtIsNil(), casbackend.ProviderNEQ(biz.CASBackendInline))
238+
query := r.data.DB.CASBackend.Query().
239+
WithOrganization().
240+
Where(casbackend.DeletedAtIsNil(),
241+
casbackend.ProviderNEQ(biz.CASBackendInline),
242+
casbackend.HasOrganizationWith(
243+
organization.DeletedAtIsNil(),
244+
),
245+
)
240246

241247
if onlyDefaults {
242248
query = query.Where(casbackend.Default(true))

0 commit comments

Comments
 (0)