MCPcopy Index your code
hub / github.com/Permify/permify / Close

Method Close

pkg/testinstance/postgres.go:30–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28var _ database.Database = (*PostgresInstance)(nil)
29
30func (p *PostgresInstance) Close() error {
31 p.closeOnce.Do(func() {
32 var errs []error
33
34 if p.Postgres != nil {
35 errs = append(errs, p.Postgres.Close())
36 }
37
38 if p.container != nil {
39 terminateCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
40 defer cancel()
41 errs = append(errs, p.container.Terminate(terminateCtx))
42 }
43
44 p.closeErr = errors.Join(errs...)
45 })
46
47 return p.closeErr
48}
49
50func (p *PostgresInstance) GetEngineType() string {
51 return p.Postgres.GetEngineType()

Callers

nothing calls this directly

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected