forked from mirrors/bookwyrm
Fixes redis call so tests don't fail
This commit is contained in:
parent
f4af1a6cb0
commit
a913524991
1 changed files with 4 additions and 2 deletions
|
@ -90,6 +90,8 @@ 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))
|
||||||
|
|
||||||
|
# only trim the stream if statuses were added
|
||||||
|
if statuses.exists():
|
||||||
pipeline.zremrangebyrank(stream_id, settings.MAX_STREAM_LENGTH, -1)
|
pipeline.zremrangebyrank(stream_id, settings.MAX_STREAM_LENGTH, -1)
|
||||||
pipeline.execute()
|
pipeline.execute()
|
||||||
|
|
||||||
|
@ -280,7 +282,7 @@ def add_statuses_on_unblock(sender, instance, *args, **kwargs):
|
||||||
|
|
||||||
@receiver(signals.post_save, sender=models.User)
|
@receiver(signals.post_save, sender=models.User)
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def populate_feed_on_account_create(sender, instance, created, *args, **kwargs):
|
def populate_streams_on_account_create(sender, instance, created, *args, **kwargs):
|
||||||
""" build a user's feeds when they join """
|
""" build a user's feeds when they join """
|
||||||
if not created or not instance.local:
|
if not created or not instance.local:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue