just backfill the heck
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test/2 Pipeline was successful
ci/woodpecker/push/test/1 Pipeline was successful
ci/woodpecker/push/build-arm64 Pipeline was successful
ci/woodpecker/push/build-amd64 Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful

This commit is contained in:
Floatingghost 2025-05-14 12:12:55 +01:00
parent fd9213dd24
commit 42b9126ec0

View file

@ -568,10 +568,9 @@ def run(["backfill_expiry", username]) do
offset = index * 60 * 10
days_offset = ttl * 24 * 60 * 60
next_expiry = DateTime.utc_now() |> DateTime.add(days_offset + offset, :second)
cutoff = DateTime.utc_now() |> DateTime.add(days_offset, :second)
posts
|> Enum.each(fn post ->
if is_nil(Map.get(post.data, "expires_at")) || Map.get(post.data, "expires_at") > cutoff do
if is_nil(Map.get(post.data, "expires_at")) do
# Set data->expires_at
new_data = Map.put(post.data, "expires_at", next_expiry)
post