FIX: Set random values for digest_attempted_at

Setting a random value in the interval 1 week ago ... now works better
because this spreads digest scheduling over a week because digests are
sent one week from the date of the last digest.
This commit is contained in:
Bianca Nenciu 2021-06-21 19:00:09 +03:00 committed by Alan Guo Xiang Tan
parent b78ab82284
commit 5efed91128

View File

@ -747,7 +747,7 @@ class ImportScripts::Base
puts "", "Updating user digest_attempted_at..."
DB.exec("UPDATE user_stats SET digest_attempted_at = now() WHERE digest_attempted_at IS NULL")
DB.exec("UPDATE user_stats SET digest_attempted_at = now() - random() * interval '1 week' WHERE digest_attempted_at IS NULL")
end
# scripts that are able to import last_seen_at from the source data should override this method