replace
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-amd64 Pipeline was successful
ci/woodpecker/push/build-arm64 Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
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-amd64 Pipeline was successful
ci/woodpecker/push/build-arm64 Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
This commit is contained in:
parent
43a8f3fee9
commit
fd9213dd24
1 changed files with 2 additions and 2 deletions
|
@ -568,10 +568,10 @@ 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")) do
|
||||
if is_nil(Map.get(post.data, "expires_at")) || Map.get(post.data, "expires_at") > cutoff do
|
||||
# Set data->expires_at
|
||||
new_data = Map.put(post.data, "expires_at", next_expiry)
|
||||
post
|
||||
|
|
Loading…
Add table
Reference in a new issue