Refactor:Move prune_old_field_tests Rake to Sidekiq Cron (#9924)

This commit is contained in:
Molly Struve 2020-08-21 11:56:42 -05:00 committed by GitHub
parent 9e40e68682
commit e8b14dec83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View file

@ -1,6 +1,9 @@
log_worker_queue_stats:
cron: "*/10 * * * *" # every 10 minutes
class: "Metrics::RecordBackgroundQueueStatsWorker"
prune_old_field_tests:
cron: "0 13 * * *" # daily at 1 pm UTC
class: "FieldTests::PruneOldExperimentsWorker"
record_daily_usage:
cron: "0 11 * * *" # daily at 11:00 UTC
class: "Metrics::RecordDailyUsageWorker"

View file

@ -26,13 +26,6 @@ task send_email_digest: :environment do
end
end
# This task is meant to be scheduled daily
task prune_old_field_tests: :environment do
# For rolling ongoing experiemnts, we remove old experiment memberships
# So that they can be re-tested.
FieldTests::PruneOldExperimentsWorker.perform_async
end
task remove_old_html_variant_data: :environment do
HtmlVariantTrial.destroy_by("created_at < ?", 2.weeks.ago)
HtmlVariantSuccess.destroy_by("created_at < ?", 2.weeks.ago)