MCPcopy Create free account
hub / github.com/foxcpp/maddy / Close

Method Close

framework/resource/singleton.go:63–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61}
62
63func (s *Singleton[T]) Close() error {
64 s.lock.Lock()
65 defer s.lock.Unlock()
66
67 for key, res := range s.resources {
68 if err := res.Close(); err != nil {
69 s.log.Error("resource close failed", err, "key", key)
70 }
71 s.log.DebugMsg("resource released", "key", key)
72 delete(s.resources, key)
73 }
74
75 return nil
76}

Callers

nothing calls this directly

Calls 3

DebugMsgMethod · 0.80
CloseMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected