Feat: graceful shutdown

This commit is contained in:
Grail Finder
2025-06-15 09:51:25 +03:00
parent fa25679624
commit 30e322d9c6
6 changed files with 153 additions and 18 deletions

View File

@ -9,6 +9,7 @@ import (
"log/slog"
"net/http"
"os"
"time"
)
var (
@ -26,6 +27,7 @@ func init() {
memcache = cache.MemCache
cfg = config.LoadConfigOrDefault("")
Notifier = broker.Notifier
cache.MemCache.StartBackupRoutine(15 * time.Second) // Reduced backup interval
}
func HandlePing(w http.ResponseWriter, r *http.Request) {