pkg/services: Check errors (#19712)

* pkg/services: Check errors
* pkg/services: Don't treat context.Canceled|context.DeadlineExceeded as error
This commit is contained in:
Arve Knudsen
2019-10-22 14:08:18 +02:00
committed by GitHub
parent de5038441f
commit 2a78d2a61c
37 changed files with 431 additions and 191 deletions
+7 -4
View File
@@ -40,10 +40,13 @@ func (srv *CleanUpService) Run(ctx context.Context) error {
srv.cleanUpTmpFiles()
srv.deleteExpiredSnapshots()
srv.deleteExpiredDashboardVersions()
srv.ServerLockService.LockAndExecute(ctx, "delete old login attempts", time.Minute*10, func() {
srv.deleteOldLoginAttempts()
})
err := srv.ServerLockService.LockAndExecute(ctx, "delete old login attempts",
time.Minute*10, func() {
srv.deleteOldLoginAttempts()
})
if err != nil {
srv.log.Error("failed to lock and execute cleanup of old login attempts", "error", err)
}
case <-ctx.Done():
return ctx.Err()
}