fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 38s
Deploy Dev / Push (pull_request) Successful in 26s
Deploy Dev / Deploy dev (pull_request) Successful in 8s

This commit is contained in:
Egor Matveev
2024-12-31 02:36:30 +03:00
parent cd798328a7
commit 9533fe5637
3 changed files with 10 additions and 0 deletions

View File

@@ -64,6 +64,8 @@ func Take(queue string) (*Task, error) {
}
_, err = collection().UpdateByID(context.TODO(), task.Id, bson.M{"$set": bson.M{"taken_at": now, "attempts": task.Attempts + 1}})
if err != nil {
println("Error updaing")
println(err.Error())
return nil, errors.ErrInternalError
}
return task, nil
@@ -78,12 +80,16 @@ func findTask(queue string, now time.Time) (*Task, error) {
},
)
if err != nil {
println("Error find")
println(err.Error())
return nil, errors.ErrInternalError
}
var results []Task
err = cursor.All(context.TODO(), &results)
if err != nil {
println("Error all")
println(err.Error())
return nil, errors.ErrInternalError
}