Enha: db use same connection to avoid db locking

This commit is contained in:
Grail Finder
2025-07-06 13:20:28 +03:00
parent e84941d593
commit 357f42c354
5 changed files with 27 additions and 15 deletions

View File

@ -24,16 +24,11 @@ func init() {
Level: slog.LevelDebug,
AddSource: true,
}))
// memcache = cache.MemCache
cfg = config.LoadConfigOrDefault("")
Notifier = broker.Notifier
// cache.MemCache.StartBackupRoutine(15 * time.Second) // Reduced backup interval
// bot loader
// check the rooms if it has bot_{digits} in them, create bots if have
repo = repos.NewRepoProvider("sqlite3://../gralias.db")
// repo = repos.NewRepoProvider("sqlite3://../gralias.db")
repo = repos.RP
recoverBots()
// if player has a roomID, but no team and role, try to recover
// recoverPlayers()
}
func HandlePing(w http.ResponseWriter, r *http.Request) {