forked from TrueCloudLab/frostfs-http-gw
[#19] Add a version with no cdn-sdk deps
Signed-off-by: Pavel Korotkov <pavel@nspcc.ru>
This commit is contained in:
parent
cdab794d62
commit
4c96885a42
20 changed files with 930 additions and 266 deletions
|
@ -8,13 +8,16 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
globalContext context.Context
|
||||
globalContexOnce sync.Once
|
||||
globalContext context.Context
|
||||
globalContextOnce sync.Once
|
||||
globalContextBarrier = make(chan struct{})
|
||||
)
|
||||
|
||||
func Context() context.Context {
|
||||
globalContexOnce.Do(func() {
|
||||
globalContextOnce.Do(func() {
|
||||
globalContext, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP)
|
||||
close(globalContextBarrier)
|
||||
})
|
||||
<-globalContextBarrier
|
||||
return globalContext
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue