FIX: Set random values for digest_attempted_at

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.

diff --git a/script/import_scripts/base.rb b/script/import_scripts/base.rb
index 7449335..a883609 100644
--- a/script/import_scripts/base.rb
+++ b/script/import_scripts/base.rb
@@ -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

GitHub sha: 5efed91128efcae4e1afeb8dc2646e2afa344545

This commit appears in #13463 which was approved by eviltrout and ZogStriP. It was merged by tgxworld.