mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-14 03:11:46 +00:00
Only fanout remote posts younger than 1 day
This commit is contained in:
parent
6c72f25fbe
commit
18ab453baa
1 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
import datetime
|
||||
import hashlib
|
||||
import json
|
||||
import mimetypes
|
||||
|
@ -75,7 +76,10 @@ class PostStates(StateGraph):
|
|||
Creates all needed fan-out objects for a new Post.
|
||||
"""
|
||||
post = await instance.afetch_full()
|
||||
await cls.targets_fan_out(post, FanOut.Types.post)
|
||||
# Only fan out if the post was published in the last day or it's local
|
||||
# (we don't want to fan out anything older that that which is remote)
|
||||
if post.local or (timezone.now() - post.published) < datetime.timedelta(days=1):
|
||||
await cls.targets_fan_out(post, FanOut.Types.post)
|
||||
await post.ensure_hashtags()
|
||||
return cls.fanned_out
|
||||
|
||||
|
|
Loading…
Reference in a new issue