Allow PBS backup poll to finish after poller returns
This commit is contained in:
parent
2c3f197f63
commit
d9c0ddaae2
1 changed files with 4 additions and 2 deletions
|
|
@ -7886,8 +7886,10 @@ func (m *Monitor) pollPBSInstance(ctx context.Context, instanceName string, clie
|
||||||
Int("datastores", len(ds)).
|
Int("datastores", len(ds)).
|
||||||
Msg("Starting background PBS backup polling")
|
Msg("Starting background PBS backup polling")
|
||||||
|
|
||||||
// Use parent context for proper cancellation chain
|
// Detached background poll: parent ctx may be cancelled when the main
|
||||||
backupCtx, cancel := context.WithTimeout(ctx, 5*time.Minute)
|
// poll cycle finishes, so use a fresh context to let PBS polling
|
||||||
|
// complete unless the explicit timeout is reached.
|
||||||
|
backupCtx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
m.pollPBSBackups(backupCtx, inst, pbsClient, ds)
|
m.pollPBSBackups(backupCtx, inst, pbsClient, ds)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue