Skip to content

Commit

Permalink
Fixed jobs clean-up again.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcwatson11 committed Feb 6, 2025
1 parent 7827d33 commit 65f3669
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/services/poll_sheet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def poll_jobs
return
end
# Delete all POLL_SHEET jobs that are older than 1 day
ActiveRecord::transaction do
ActiveRecord::Base.transaction do
ActiveRecord::Base.connection.execute("DELETE FROM logs WHERE jobs_id IN (SELECT id FROM jobs WHERE type = 'POLL_SHEET' AND created_at < NOW() - INTERVAL '1 day')")
ActiveRecord::Base.connection.execute("DELETE FROM jobs WHERE type = 'POLL_SHEET' AND created_at < NOW() - INTERVAL '1 day'")
end
Expand Down
2 changes: 1 addition & 1 deletion app/services/woo_refresh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def poll_jobs
return
end
# Delete all WOO_REFRESH jobs that are older than 1 day
ActiveRecord::transaction do
ActiveRecord::Base.transaction do
ActiveRecord::Base.connection.execute("DELETE FROM logs WHERE jobs_id IN (SELECT id FROM jobs WHERE type = 'WOO_REFRESH' AND created_at < NOW() - INTERVAL '1 day')")
ActiveRecord::Base.connection.execute("DELETE FROM jobs WHERE type = 'WOO_REFRESH' AND created_at < NOW() - INTERVAL '1 day'")
end
Expand Down

0 comments on commit 65f3669

Please sign in to comment.