Skip to content

Commit

Permalink
Spam wave expiration validation to <= 368.day.from_now
Browse files Browse the repository at this point in the history
The way we've been using spam waves has changed over the years.
While the default creation length remains 1 day and "renew"
remains 2 days, there are multiple spam waves which we are
keeping active continuously, and have done so for years. I'm
quite tired of having the daily task of renewing them, as I've
been doing nearly every day for a couple/few years now. This
change will allow manually editing the expiration time to
1 year in the future from any automated (i.e., 1 or 2 day)
date.
  • Loading branch information
makyen committed Nov 11, 2024
1 parent e7676a1 commit 5f9a1aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/spam_wave.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def check_min_accuracy
end

def max_expiry
return if expiry <= 2.day.from_now
return if expiry <= 368.day.from_now
errors.add(:expiry, 'must be no more than 48 hours from now')
end
end

0 comments on commit 5f9a1aa

Please sign in to comment.