From 5d6a058b984d823b6db37d3fe10d6b67451ceeb4 Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Fri, 24 Jan 2025 08:46:20 -0800 Subject: [PATCH] temporarily disable pitt jobs until bugs are fixed --- app/models/account_decorator.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/models/account_decorator.rb b/app/models/account_decorator.rb index 8381228..3aa3c2d 100644 --- a/app/models/account_decorator.rb +++ b/app/models/account_decorator.rb @@ -14,3 +14,20 @@ # TODO: Does redeclaring this work? We'll want to write a test for this. Account.setting :contact_email, type: 'string', default: 'consortial-ir@palci.org' Account.setting :contact_email_to, type: 'string', default: 'consortial-ir@palci.org' + +# Temporarily disable Google Analytics jobs +# because they are buggy and distruptive +def find_or_schedule_jobs + account = Site.account + AccountElevator.switch!(self) + [ + EmbargoAutoExpiryJob, + LeaseAutoExpiryJob, + # BatchEmailNotificationJob, + # DepositorEmailNotificationJob, + # UserStatCollectionJob + ].each do |klass| + klass.perform_later unless find_job(klass) + end + account ? AccountElevator.switch!(account) : reset! +end \ No newline at end of file