Skip to content

Commit

Permalink
Implement queue length for redis
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Aug 16, 2023
1 parent fcf22db commit f718be0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/jobsystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,11 @@ func (j *RedisJobSystem) Dequeue() (*Ticket, error) {
}

func (j *RedisJobSystem) QueueLength() (int, error) {
return 0, errors.New("not implemented")
length, err := j.Client.ZCount("mmseqs:pending", "-inf", "+inf").Result()
if err != nil {
return 0, err
}
return int(length), nil
}

type LocalJobSystem struct {
Expand Down

0 comments on commit f718be0

Please sign in to comment.