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
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()