removed logs fails/retry since it is now handled by default in daos.Dao

This commit is contained in:
Gani Georgiev 2022-12-11 01:39:13 +02:00
parent 007fcd36b8
commit 506bfca8b2
1 changed files with 2 additions and 13 deletions

View File

@ -333,19 +333,8 @@ func ActivityLogger(app core.App) echo.MiddlewareFunc {
model.RefreshUpdated() model.RefreshUpdated()
routine.FireAndForget(func() { routine.FireAndForget(func() {
attempts := 1 if err := app.LogsDao().SaveRequest(model); err != nil && app.IsDebug() {
log.Println("Log save failed:", err)
BeginSave:
logErr := app.LogsDao().SaveRequest(model)
if logErr != nil {
// try one more time after 10s in case of SQLITE_BUSY or "database is locked" error
if attempts <= 2 {
attempts++
time.Sleep(10 * time.Second)
goto BeginSave
} else if app.IsDebug() {
log.Println("Log save failed:", logErr)
}
} }
// Delete old request logs // Delete old request logs