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

Method Cleanup

scaletest/workspaceupdates/run.go:264–282  ·  view source on GitHub ↗
(ctx context.Context, id string, logs io.Writer)

Source from the content-addressed store, hash-verified

262}
263
264func (r *Runner) Cleanup(ctx context.Context, id string, logs io.Writer) error {
265 for i, runner := range r.workspacebuildRunners {
266 if runner != nil {
267 _, _ = fmt.Fprintf(logs, "Cleaning up workspace %d/%d...\n", i+1, len(r.workspacebuildRunners))
268 if err := runner.Cleanup(ctx, fmt.Sprintf("%s-%d", id, i), logs); err != nil {
269 return xerrors.Errorf("cleanup workspace %d: %w", i, err)
270 }
271 }
272 }
273
274 if r.createUserRunner != nil {
275 _, _ = fmt.Fprintln(logs, "Cleaning up user...")
276 if err := r.createUserRunner.Cleanup(ctx, id, logs); err != nil {
277 return xerrors.Errorf("cleanup user: %w", err)
278 }
279 }
280
281 return nil
282}

Callers 1

TestRunFunction · 0.95

Calls 2

CleanupMethod · 0.65
ErrorfMethod · 0.45

Tested by 1

TestRunFunction · 0.76