Skip to content

Commit d3220c5

Browse files
authored
fix: resolve flake in log sender by checking context (#9865)
See: https://github.com/coder/coder/actions/runs/6305051172/job/17117693579
1 parent 1262eef commit d3220c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

codersdk/agentsdk/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func LogsSender(sourceID uuid.UUID, patchLogs func(ctx context.Context, req Patc
153153
// error occurs. Note that we use the main context here,
154154
// meaning these requests won't be interrupted by
155155
// shutdown.
156-
for r := retry.New(time.Second, 5*time.Second); r.Wait(ctx); {
156+
for r := retry.New(time.Second, 5*time.Second); r.Wait(ctx) && ctx.Err() == nil; {
157157
err := patchLogs(ctx, PatchLogs{
158158
Logs: backlog,
159159
LogSourceID: sourceID,

0 commit comments

Comments
 (0)