MCPcopy
hub / github.com/SurgeDM/Surge / CloseDB

Function CloseDB

internal/engine/state/db.go:60–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58}
59
60func CloseDB() {
61 masterMu.Lock()
62 defer masterMu.Unlock()
63 baseDir = ""
64 configured = false
65 // Reset cleanupOnce under its own dedicated mutex so it is safe to call
66 // concurrently with ensureDirs, which also holds cleanupMu when it reads it.
67 cleanupMu.Lock()
68 cleanupOnce = sync.Once{}
69 cleanupMu.Unlock()
70}
71
72func atomicWrite(targetPath string, data interface{}) error {
73 dir := filepath.Dir(targetPath)

Calls

no outgoing calls