Compare commits

..

No commits in common. "71e40b932c9e0fdef87fc94748bcbc1edb591952" and "39829a734811871c33368fe23c2dae85e95f5e35" have entirely different histories.

2 changed files with 10 additions and 12 deletions

View File

@ -5,14 +5,12 @@ import (
"net/http"
tasks "queues-go/app/storage/mongo/collections"
"time"
"go.mongodb.org/mongo-driver/bson"
)
type PutRequestBody struct {
Payload bson.M `json:"payload"`
SecondsToExecute int `json:"seconds_to_execute"`
Delay *int `json:"delay"`
Payload json.RawMessage `json:"payload"`
SecondsToExecute int `json:"seconds_to_execute"`
Delay *int `json:"delay"`
}
func Put(w http.ResponseWriter, r *http.Request) {

View File

@ -23,13 +23,13 @@ type Task struct {
}
type InsertedTask struct {
Queue string `bson:"queue"`
Payload bson.M `bson:"payload"`
PutAt time.Time `bson:"put_at"`
AvailableFrom time.Time `bson:"available_from"`
SecondsToExecute int `bson:"seconds_to_execute"`
TakenAt *time.Time `bson:"taken_at"`
Attempts int `bson:"attempts"`
Queue string `bson:"queue"`
Payload interface{} `bson:"payload"`
PutAt time.Time `bson:"put_at"`
AvailableFrom time.Time `bson:"available_from"`
SecondsToExecute int `bson:"seconds_to_execute"`
TakenAt *time.Time `bson:"taken_at"`
Attempts int `bson:"attempts"`
}
func Add(task InsertedTask) error {