MCPcopy Index your code
hub / github.com/aptly-dev/aptly / acquireDatabaseConnection

Function acquireDatabaseConnection

api/api.go:141–150  ·  view source on GitHub ↗

Should be called before database access is needed in any api call. Happens per default for each api call. It is important that you run runTaskInBackground to run a task which accquire database. Important do not forget to defer to releaseDatabaseConnection

()

Source from the content-addressed store, hash-verified

139// runTaskInBackground to run a task which accquire database.
140// Important do not forget to defer to releaseDatabaseConnection
141func acquireDatabaseConnection() error {
142 if dbRequests == nil {
143 return nil
144 }
145
146 errCh := make(chan error)
147 dbRequests <- dbRequest{acquiredb, errCh}
148
149 return <-errCh
150}
151
152// Release database connection when not needed anymore
153func releaseDatabaseConnection() error {

Callers 1

runTaskInBackgroundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected