MCPcopy Index your code
hub / github.com/coder/coder / flushQueuedLogs

Method flushQueuedLogs

provisionerd/runner/runner.go:1178–1196  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

1176}
1177
1178func (r *Runner) flushQueuedLogs(ctx context.Context) {
1179 r.mutex.Lock()
1180 if r.flushLogsTimer != nil {
1181 r.flushLogsTimer.Stop()
1182 }
1183 logs := r.queuedLogs
1184 r.queuedLogs = make([]*proto.Log, 0)
1185 r.mutex.Unlock()
1186 _, err := r.update(ctx, &proto.UpdateJobRequest{
1187 JobId: r.job.JobId,
1188 Logs: logs,
1189 })
1190 if err != nil {
1191 if errors.Is(err, errUpdateSkipped) {
1192 return
1193 }
1194 r.logger.Error(ctx, "flush queued logs", slog.Error(err))
1195 }
1196}
1197
1198func redactVariableValues(variableValues []*sdkproto.VariableValue) []*sdkproto.VariableValue {
1199 var redacted []*sdkproto.VariableValue

Callers 3

doCleanFinishMethod · 0.95
runWorkspaceBuildMethod · 0.95
queueLogMethod · 0.95

Calls 6

updateMethod · 0.95
StopMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45
IsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected