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

Method Cleanup

scaletest/createworkspaces/run.go:161–182  ·  view source on GitHub ↗

Cleanup implements Cleanable.

(ctx context.Context, id string, logs io.Writer)

Source from the content-addressed store, hash-verified

159
160// Cleanup implements Cleanable.
161func (r *Runner) Cleanup(ctx context.Context, id string, logs io.Writer) error {
162 if r.cfg.NoCleanup {
163 _, _ = fmt.Fprintln(logs, "skipping cleanup")
164 return nil
165 }
166
167 if r.workspacebuildRunner != nil {
168 err := r.workspacebuildRunner.Cleanup(ctx, id, logs)
169 if err != nil {
170 return xerrors.Errorf("cleanup workspace: %w", err)
171 }
172 }
173
174 if r.createUserRunner != nil {
175 err := r.createUserRunner.Cleanup(ctx, id, logs)
176 if err != nil {
177 return xerrors.Errorf("cleanup user: %w", err)
178 }
179 }
180
181 return nil
182}

Callers 1

Test_RunnerFunction · 0.95

Calls 2

CleanupMethod · 0.65
ErrorfMethod · 0.45

Tested by 1

Test_RunnerFunction · 0.76