Skip to content

Commit

Permalink
remove auto-retries on registry scans
Browse files Browse the repository at this point in the history
  • Loading branch information
noboruma committed Jun 5, 2024
1 parent 41c68f9 commit fa96fce
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions deepfence_worker/cronjobs/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ func syncRegistry(ctx context.Context, pgClient *postgresql_db.Queries, registri

log := log.WithCtx(ctx)

enqueuer, err := directory.Worker(ctx)
if err != nil {
return err
}

toRetry := []int32{}
for _, row := range registries {
r, err := registry.GetRegistryWithRegistryRow(row)
if err != nil {
Expand All @@ -92,21 +86,11 @@ func syncRegistry(ctx context.Context, pgClient *postgresql_db.Queries, registri

err = sync.SyncRegistry(ctx, pgClient, r, row)
if err != nil {
log.Error().Msgf("unable to sync registry: %s (%s): %v", row.RegistryType, row.Name, err)
toRetry = append(toRetry, row.ID)
log.Error().Msgf("(skipping) unable to sync registry: %s (%s): %v", row.RegistryType, row.Name, err)
continue
}
}

for i := range toRetry {
payload, err := json.Marshal(utils.RegistrySyncParams{
PgID: toRetry[i],
})
if err != nil {
log.Error().Msgf("unable to retry sync registry: %v", err)
}
enqueuer.Enqueue(utils.SyncRegistryTask, payload)
}
return nil
}

Expand Down

0 comments on commit fa96fce

Please sign in to comment.