– Remove job from reliability queue redis.call(“LREM”, KEYS, 0, ARGV) redis.call(“ZREM”, KEYS, ARGV)
– Add job and its fail time (score) to failed sorted set redis.call(“ZADD”, KEYS, ARGV, ARGV)
– Remove any jobs that have been given up long enough ago (their score is – below given value) and make sure the number of jobs is capped redis.call(“ZREMRANGEBYSCORE”, KEYS, “-inf”, ARGV) redis.call(“ZREMRANGEBYRANK”, KEYS, 0, -ARGV - 1)