Skip to content

Commit b2df714

Browse files
committed
xerrors.Is
1 parent 20abd69 commit b2df714

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

coderd/notifications/reports/generator.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func reportFailedWorkspaceBuilds(ctx context.Context, logger slog.Logger, db dat
136136
}
137137

138138
for _, stats := range templateStatsRows {
139-
if ctx.Err() == context.Canceled {
139+
if xerrors.Is(ctx.Err(), context.Canceled) {
140140
logger.Debug(ctx, "context is canceled, quitting")
141141
break
142142
}
@@ -171,7 +171,7 @@ func reportFailedWorkspaceBuilds(ctx context.Context, logger slog.Logger, db dat
171171
}
172172

173173
for _, templateAdmin := range templateAdmins {
174-
if ctx.Err() == context.Canceled {
174+
if xerrors.Is(ctx.Err(), context.Canceled) {
175175
logger.Debug(ctx, "context is canceled, quitting")
176176
break
177177
}
@@ -190,7 +190,7 @@ func reportFailedWorkspaceBuilds(ctx context.Context, logger slog.Logger, db dat
190190
}
191191
}
192192

193-
if ctx.Err() == context.Canceled {
193+
if xerrors.Is(ctx.Err(), context.Canceled) {
194194
logger.Error(ctx, "report generator job is canceled")
195195
return ctx.Err()
196196
}

0 commit comments

Comments
 (0)