mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
fix(machine): improve context cancellation handling during watch and sync operations
This commit is contained in:
1 parent
83256b5bf7
commit
328d17599b
3 files changed
+9
-5
No files matched your search
@@ -620,7 +620,7 @@ func (cc *clusterController) syncDockerContainers(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
if err := backoff.Retry(watchAndSync, boff); err != nil {
|
||||
if errors.Is(err, context.Canceled) {
|
||||
if ctx.Err() != nil {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("watch and sync containers to cluster store: %w", err)
|
||||
|
||||
@@ -139,7 +139,7 @@ func (c *Controller) WatchAndSyncContainers(ctx context.Context) error {
|
||||
return fmt.Errorf("sync containers to cluster store: %w", err)
|
||||
}
|
||||
case err := <-errCh:
|
||||
if errors.Is(err, context.Canceled) {
|
||||
if ctx.Err() != nil {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("receive Docker event: %w", err)
|
||||
|
||||
Reference in new issue
Block a user