Compare commits

..

No commits in common. "39829a734811871c33368fe23c2dae85e95f5e35" and "9d9c11cf116ce263e21306eefa15df8c5a0015f9" have entirely different histories.

3 changed files with 0 additions and 10 deletions

View File

@ -6,8 +6,6 @@ services:
image: mathwave/sprint-repo:queues
networks:
- queues-development
ports:
- 1239:1239
environment:
MONGO_HOST: "mongo.develop.sprinthub.ru"
MONGO_PASSWORD: $MONGO_PASSWORD_DEV

View File

@ -20,7 +20,6 @@ func Take(w http.ResponseWriter, r *http.Request) {
queue := r.Header.Get("queue")
task, err := tasks.Take(queue)
if err != nil {
println("Error taking")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -38,7 +37,6 @@ func Take(w http.ResponseWriter, r *http.Request) {
data, err := json.Marshal(response)
if err != nil {
println("Error marshalling")
w.WriteHeader(http.StatusInternalServerError)
return
}

View File

@ -64,8 +64,6 @@ 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
@ -80,16 +78,12 @@ 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
}