Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blackroot committed Dec 6, 2021
1 parent 307b5dc commit ada97ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions xdelay_queue/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func (dq *DelayQueue) addJobToBucketZ(timestamp int64, jobId string) error {
}

func (dq *DelayQueue) getJobFromBucketZ(key string) (*BucketZ, error) {
//zrangebyscore zrangebyscorewithscores
result, err := dq.ZRangeWithScores(key, 0, 0).Result()
if err != nil {
if errors.Is(err, redis.Nil) {
Expand Down
1 change: 1 addition & 0 deletions xdelay_queue/delay_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (dq *DelayQueue) AddJob(job *Job) error {
return errors.New("invalid job")
}

job.Delay = job.Delay + time.Now().Unix()
value, err := json.Marshal(job)
if err != nil {
return errors.WithStack(err)
Expand Down

0 comments on commit ada97ea

Please sign in to comment.