Add get_job_position and get_position feature#1271
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1271 +/- ##
==========================================
+ Coverage 93.72% 93.87% +0.15%
==========================================
Files 22 22
Lines 2341 2352 +11
==========================================
+ Hits 2194 2208 +14
+ Misses 147 144 -3
Continue to review full report at Codecov.
|
Fix rq#1197 Signed-off-by: Paul Spooren <[email protected]>
| job_id = job_or_id.id if isinstance(job_or_id, self.job_class) else job_or_id | ||
| if job_id in self.job_ids: | ||
| return self.job_ids.index(job_id) |
There was a problem hiding this comment.
https://redis.io/commands/lpos has been added to Redis' docs. Should we first try to use lpos before falling back to this?
lpos is only available on Redis >= 6.0.6 so most servers won't have it, but the numbers should grow over time.
There was a problem hiding this comment.
We used to have checks for PY2/3. We've never had checks for Redis server version before.
I'm open to however you want to implement this, as long as the implementation is sound. I'm even ok with try/except because this is not a performance sensitive area of the codebase.
There was a problem hiding this comment.
I'd suggest to merge it now and I'll do a two part PR later, adding Redis version awareness and to automatically use LPOS if both py-redis and Redis are the correct version
Fix #1197
Signed-off-by: Paul Spooren [email protected]