summaryrefslogtreecommitdiffstats
path: root/modules/nosql/manager.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nosql/manager.go')
-rw-r--r--modules/nosql/manager.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/nosql/manager.go b/modules/nosql/manager.go
index a89b5bb633..dab30812ce 100644
--- a/modules/nosql/manager.go
+++ b/modules/nosql/manager.go
@@ -5,10 +5,12 @@
package nosql
import (
+ "context"
"strconv"
"sync"
"time"
+ "code.gitea.io/gitea/modules/process"
"github.com/go-redis/redis/v8"
"github.com/syndtr/goleveldb/leveldb"
)
@@ -17,7 +19,9 @@ var manager *Manager
// Manager is the nosql connection manager
type Manager struct {
- mutex sync.Mutex
+ ctx context.Context
+ finished context.CancelFunc
+ mutex sync.Mutex
RedisConnections map[string]*redisClientHolder
LevelDBConnections map[string]*levelDBHolder
@@ -46,7 +50,10 @@ func init() {
// GetManager returns a Manager and initializes one as singleton is there's none yet
func GetManager() *Manager {
if manager == nil {
+ ctx, _, finished := process.GetManager().AddTypedContext(context.Background(), "Service: NoSQL", process.SystemProcessType, false)
manager = &Manager{
+ ctx: ctx,
+ finished: finished,
RedisConnections: make(map[string]*redisClientHolder),
LevelDBConnections: make(map[string]*levelDBHolder),
}