`completed` and `failed` should be zsets, not sets
Created by: evanhuang8
What's the reasoning for using sets instead of lists for completed
and failed
jobs? By using sets for the two categories, it will not be safe or optimal to fetch jobs from the two, especially for management purposes. As of now, getCompleted
and getFailed
will result in the whole set being fetched, which can potentially result in slow performance and even crash the queue if the sets are too big.
By using clean
, I suppose the two sets can be kept in reasonable size, but there are use cases where jobs should be kept in the queue indefinitely, for records or other purposes. As far as I know, we are not doing any set operations on the two, so why don't we just use lists instead?