Skip to content

Commit

Permalink
removed logs fails/retry since it is now handled by default in daos.Dao
Browse files Browse the repository at this point in the history
  • Loading branch information
ganigeorgiev committed Dec 10, 2022
1 parent 007fcd3 commit 506bfca
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions apis/middlewares.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,19 +333,8 @@ func ActivityLogger(app core.App) echo.MiddlewareFunc {
model.RefreshUpdated()

routine.FireAndForget(func() {
attempts := 1

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)
}
if err := app.LogsDao().SaveRequest(model); err != nil && app.IsDebug() {
log.Println("Log save failed:", err)
}

// Delete old request logs
Expand Down

0 comments on commit 506bfca

Please sign in to comment.