Browse Source

En cours de développement

master
losyme 2 months ago
parent
commit
6d96139c76
  1. 8
      internal/storage/mongo/next.go

8
internal/storage/mongo/next.go

@ -13,6 +13,7 @@ import (
"forge.chapril.org/losyme/util"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"forge.chapril.org/dune/dune/internal/storage"
)
@ -67,6 +68,13 @@ func (ms *mongoStorage) NextJob(namespace string, fn storage.SelectNextJob) (*jw
{"status": jw.StatusPending},
},
},
options.Find().SetSort(
[]bson.M{
{"priority": 1},
{"weight": -1},
{"time_reference": -1},
},
),
)
if err != nil {
return nil, err

Loading…
Cancel
Save