fix(stats): fix crash when messages task fails, add Sentry integration

This commit is contained in:
spiral 2022-11-23 05:17:56 +00:00
parent 7ffe83ab5e
commit 898d23d733
No known key found for this signature in database
GPG key ID: 244A11E4B0BCF40E
2 changed files with 31 additions and 12 deletions

View file

@ -4,20 +4,9 @@ import (
"context"
"fmt"
"log"
"runtime/debug"
"strings"
)
func task_main() {
defer func() {
if err := recover(); err != nil {
stack := strings.Split(string(debug.Stack()), "\n")
stack = stack[7:]
log.Println("error running tasks:", err.(error).Error())
fmt.Println(strings.Join(stack, "\n"))
}
}()
log.Println("running per-minute scheduled tasks")
update_db_meta()