mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
Handling missing position.
This commit is contained in:
parent
6868d223b9
commit
82cc26cd07
1 changed files with 2 additions and 0 deletions
|
@ -1664,6 +1664,8 @@ class RNewUserQueue:
|
|||
def user_position(cls, user_id):
|
||||
r = redis.Redis(connection_pool=settings.REDIS_FEED_UPDATE_POOL)
|
||||
position = r.zrank(cls.KEY, user_id)
|
||||
if position is None:
|
||||
return 1
|
||||
if position >= 0:
|
||||
return position + 1
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue