forked from AkkomaGang/akkoma
don't expire pinned posts
This commit is contained in:
parent
57b455de5a
commit
eec1ba232c
1 changed files with 6 additions and 2 deletions
|
@ -150,8 +150,12 @@ def run(["ensure_expiration"]) do
|
||||||
|> Pleroma.RepoStreamer.chunk_stream(100)
|
|> Pleroma.RepoStreamer.chunk_stream(100)
|
||||||
|> Stream.each(fn activities ->
|
|> Stream.each(fn activities ->
|
||||||
Enum.each(activities, fn activity ->
|
Enum.each(activities, fn activity ->
|
||||||
expires_at = Timex.shift(activity.inserted_at, days: days)
|
user = User.get_cached_by_ap_id(activity.actor)
|
||||||
Pleroma.ActivityExpiration.create(activity, expires_at, false)
|
|
||||||
|
if activity.id not in user.pinned_activities do
|
||||||
|
expires_at = Timex.shift(activity.inserted_at, days: days)
|
||||||
|
Pleroma.ActivityExpiration.create(activity, expires_at, false)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|> Stream.run()
|
|> Stream.run()
|
||||||
|
|
Loading…
Reference in a new issue