fix: resolve flake in log sender by checking context (#9865)

See: https://github.com/coder/coder/actions/runs/6305051172/job/17117693579
This commit is contained in:
Kyle Carberry
2023-09-25 22:19:27 +00:00
committed by GitHub
parent 1262eef2c0
commit d3220c5db9
+1 -1
View File
@@ -153,7 +153,7 @@ func LogsSender(sourceID uuid.UUID, patchLogs func(ctx context.Context, req Patc
// error occurs. Note that we use the main context here,
// meaning these requests won't be interrupted by
// shutdown.
for r := retry.New(time.Second, 5*time.Second); r.Wait(ctx); {
for r := retry.New(time.Second, 5*time.Second); r.Wait(ctx) && ctx.Err() == nil; {
err := patchLogs(ctx, PatchLogs{
Logs: backlog,
LogSourceID: sourceID,