storj/internal/storjql/schema.go
Yehor Butko 3e2c101bd8
V3-1152 Node bootstrap web backend (#1327)
* V3-1152 Node bootstrap
2019-03-05 12:38:21 +02:00

20 lines
357 B
Go

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package storjql
import (
"sync"
)
// mu allows to lock graphql methods, because some of them are not thread-safe
var mu sync.Mutex
// WithLock locks graphql methods, because some of them are not thread-safe
func WithLock(fn func()) {
mu.Lock()
defer mu.Unlock()
fn()
}