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

Method Delete

agent/agentcontainers/api_test.go:462–482  ·  view source on GitHub ↗
(ctx context.Context, id uuid.UUID)

Source from the content-addressed store, hash-verified

460}
461
462func (m *fakeSubAgentClient) Delete(ctx context.Context, id uuid.UUID) error {
463 m.logger.Debug(ctx, "deleting sub agent", slog.F("id", id.String()))
464 if m.deleteErrC != nil {
465 select {
466 case <-ctx.Done():
467 return ctx.Err()
468 case err := <-m.deleteErrC:
469 if err != nil {
470 return err
471 }
472 }
473 }
474 m.mu.Lock()
475 defer m.mu.Unlock()
476 if m.agents == nil {
477 m.agents = make(map[uuid.UUID]agentcontainers.SubAgent)
478 }
479 delete(m.agents, id)
480 m.deleted = append(m.deleted, id)
481 return nil
482}
483
484// fakeExecer implements agentexec.Execer for testing and tracks execution details.
485type fakeExecer struct {

Callers

nothing calls this directly

Calls 5

ErrMethod · 0.80
StringMethod · 0.45
DoneMethod · 0.45
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected