MCPcopy
hub / github.com/gotify/server / Do

Method Do

api/stream/once.go:19–26  ·  view source on GitHub ↗
(f func())

Source from the content-addressed store, hash-verified

17}
18
19func (o *once) Do(f func()) {
20 if atomic.LoadUint32(&o.done) == 1 {
21 return
22 }
23 if o.mayExecute() {
24 f()
25 }
26}
27
28func (o *once) mayExecute() bool {
29 o.m.Lock()

Callers 15

Test_ExecuteFunction · 0.95
CloseMethod · 0.80
NotifyCloseMethod · 0.80
TestHeaderInDevMethod · 0.80
TestHeaderInProdMethod · 0.80
TestInvalidOriginFunction · 0.80
TestCORSHeaderRegexFunction · 0.80
TestCORSConfigOverrideFunction · 0.80

Calls 1

mayExecuteMethod · 0.95

Tested by 14

Test_ExecuteFunction · 0.76
TestHeaderInDevMethod · 0.64
TestHeaderInProdMethod · 0.64
TestInvalidOriginFunction · 0.64
TestCORSHeaderRegexFunction · 0.64
TestCORSConfigOverrideFunction · 0.64
TestOptionsRequestMethod · 0.64
TestSendMessageMethod · 0.64