@ -76,7 +76,7 @@ func (ms *mongoStorage) InsertJob(job *jw.Job) (bool, error) {
}
func (ms *mongoStorage) UpdateJob(job *jw.Job) error {
return errors.NotImplemented()
return nil
func (ms *mongoStorage) NotifyJob(id string, data interface{}) error {
@ -61,6 +61,7 @@ func (ms *mongoStorage) NextJob(namespace string, fn storage.SelectNextJob) (*jw
ctx,
bson.M{
"namespace": namespace,
"run_after": bson.M{"$lt": time.Now()},
"$or": []bson.M{
{"status": jw.StatusTodo},
{"status": jw.StatusPending},