mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-29 21:11:16 +00:00
Python format
This commit is contained in:
parent
c0f7cbc5f0
commit
880323e838
1 changed files with 3 additions and 13 deletions
|
@ -36,9 +36,7 @@ class ActivityStream(ABC):
|
||||||
# add the status to the feed
|
# add the status to the feed
|
||||||
pipeline.zadd(self.stream_id(user), value)
|
pipeline.zadd(self.stream_id(user), value)
|
||||||
pipeline.zremrangebyrank(
|
pipeline.zremrangebyrank(
|
||||||
self.stream_id(user),
|
self.stream_id(user), settings.MAX_STREAM_LENGTH, -1
|
||||||
settings.MAX_STREAM_LENGTH,
|
|
||||||
-1
|
|
||||||
)
|
)
|
||||||
# add to the unread status count
|
# add to the unread status count
|
||||||
pipeline.incr(self.unread_id(user))
|
pipeline.incr(self.unread_id(user))
|
||||||
|
@ -57,11 +55,7 @@ class ActivityStream(ABC):
|
||||||
pipeline = r.pipeline()
|
pipeline = r.pipeline()
|
||||||
for status in user.status_set.all()[: settings.MAX_STREAM_LENGTH]:
|
for status in user.status_set.all()[: settings.MAX_STREAM_LENGTH]:
|
||||||
pipeline.zadd(self.stream_id(viewer), self.get_value(status))
|
pipeline.zadd(self.stream_id(viewer), self.get_value(status))
|
||||||
pipeline.zremrangebyrank(
|
pipeline.zremrangebyrank(self.stream_id(user), settings.MAX_STREAM_LENGTH, -1)
|
||||||
self.stream_id(user),
|
|
||||||
settings.MAX_STREAM_LENGTH,
|
|
||||||
-1
|
|
||||||
)
|
|
||||||
pipeline.execute()
|
pipeline.execute()
|
||||||
|
|
||||||
def remove_user_statuses(self, viewer, user):
|
def remove_user_statuses(self, viewer, user):
|
||||||
|
@ -96,11 +90,7 @@ class ActivityStream(ABC):
|
||||||
for status in statuses.all()[: settings.MAX_STREAM_LENGTH]:
|
for status in statuses.all()[: settings.MAX_STREAM_LENGTH]:
|
||||||
pipeline.zadd(stream_id, self.get_value(status))
|
pipeline.zadd(stream_id, self.get_value(status))
|
||||||
|
|
||||||
pipeline.zremrangebyrank(
|
pipeline.zremrangebyrank(stream_id, settings.MAX_STREAM_LENGTH, -1)
|
||||||
stream_id,
|
|
||||||
settings.MAX_STREAM_LENGTH,
|
|
||||||
-1
|
|
||||||
)
|
|
||||||
pipeline.execute()
|
pipeline.execute()
|
||||||
|
|
||||||
def stream_users(self, status): # pylint: disable=no-self-use
|
def stream_users(self, status): # pylint: disable=no-self-use
|
||||||
|
|
Loading…
Reference in a new issue