Skip to content

Commit

Permalink
worker: check api.ErrSlabNotFound
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Sep 13, 2024
1 parent f72fd85 commit 77319a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,15 @@ func (w *Worker) slabMigrateHandler(jc jape.Context) {

// migrate the slab and handle alerts
err = w.migrate(ctx, slab, up.ContractSet, dlContracts, ulContracts, up.CurrentHeight)
if err != nil {
if err != nil && !utils.IsErr(err, api.ErrSlabNotFound) {
var objects []api.ObjectMetadata
if res, err := w.bus.ListObjects(ctx, api.ListObjectOptions{SlabKey: &slab.Key}); err != nil {
w.logger.Errorf("failed to list objects for slab key; %w", err)
} else {
objects = res.Objects
}
w.alerts.RegisterAlert(ctx, newMigrationFailedAlert(slab.Key, slab.Health, objects, err))
} else {
} else if err == nil {
w.alerts.DismissAlerts(jc.Request.Context(), alerts.IDForSlab(alertMigrationID, slab.Key))
}

Expand Down

0 comments on commit 77319a4

Please sign in to comment.