0

[WIP] Add cron-like job for periodic maintenance of settings db, update TODO.md

This commit is contained in:
eleksir
2025-11-02 12:22:37 +03:00
parent fbd0196a48
commit 61208f5247
13 changed files with 504 additions and 12 deletions

View File

@@ -42,18 +42,12 @@ func SigHandler() {
log.Debug("Close redis connection")
}
// close all telego stuff.
resp, err := tg.LogOut()
if err != nil {
log.Errorf("Unable to send LogOut() to Telegram Bot API server")
// Quit all scheduled periodic jobs.
for _, job := range PeriodicJobs {
job.Quit <- true
}
if !resp.Ok {
log.Errorf("Telegram Bot API returns an error on LogOut(): %d, %s", resp.ErrorCode, resp.Description)
}
resp, err = tg.Close()
resp, err := tg.Close()
if err != nil {
log.Errorf("Unable to send Close() to Telegram Bot API server")