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

Method clean

coderd/database/dbtestutil/broker.go:94–106  ·  view source on GitHub ↗
(t TBSubset, dbName string)

Source from the content-addressed store, hash-verified

92}
93
94func (b *Broker) clean(t TBSubset, dbName string) func() {
95 return func() {
96 _, err := b.coderTestingDB.Exec("DROP DATABASE " + dbName + ";")
97 if err != nil {
98 t.Logf("failed to clean up database %q: %s\n", dbName, err.Error())
99 return
100 }
101 _, err = b.coderTestingDB.Exec("UPDATE test_databases SET dropped_at = CURRENT_TIMESTAMP WHERE name = $1", dbName)
102 if err != nil {
103 t.Logf("failed to mark test database '%s' dropped: %s\n", dbName, err.Error())
104 }
105 }
106}
107
108func (b *Broker) init(t TBSubset) error {
109 b.Lock()

Callers 4

CreateMethod · 0.95

Calls 3

ExecMethod · 0.65
LogfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected