Browse Source

En cours de développement

master
losyme 2 months ago
parent
commit
5112f2d71e
  1. 9
      internal/storage/mongo/next.go

9
internal/storage/mongo/next.go

@ -12,6 +12,7 @@ import (
"forge.chapril.org/dune/jw"
"forge.chapril.org/losyme/util"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
@ -69,10 +70,10 @@ func (ms *mongoStorage) NextJob(namespace string, fn storage.SelectNextJob) (*jw
},
},
options.Find().SetSort(
[]bson.M{
{"priority": 1},
{"weight": -1},
{"time_reference": -1},
bson.D{
primitive.E{Key: "priority", Value: 1},
primitive.E{Key: "weight", Value: -1},
primitive.E{Key: "time_reference", Value: -1},
},
),
)

Loading…
Cancel
Save