fix for tag sub update
This commit is contained in:
@@ -5,6 +5,7 @@ class DailyMaintenance
|
||||
Upload.delete_all(['created_at < ?', 1.day.ago])
|
||||
ModAction.delete_all(['created_at < ?', 3.days.ago])
|
||||
Delayed::Job.delete_all(['created_at < ?'], 1.day.ago)
|
||||
prune_ad_hits
|
||||
end
|
||||
|
||||
def prune_ad_hits
|
||||
|
||||
@@ -128,14 +128,16 @@ class TagSubscription < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def self.process_all
|
||||
find_each do |tag_subscription|
|
||||
if $job_task_daemon_active != false && tag_subscription.creator.is_privileged? && tag_subscription.is_active?
|
||||
begin
|
||||
tag_subscription.process
|
||||
tag_subscription.save
|
||||
sleep 0
|
||||
rescue Exception => x
|
||||
raise if Rails.env != "production"
|
||||
CurrentUser.scoped(User.admins.first, "127.0.0.1") do
|
||||
find_each do |tag_subscription|
|
||||
if $job_task_daemon_active != false && tag_subscription.creator.is_privileged? && tag_subscription.is_active?
|
||||
begin
|
||||
tag_subscription.process
|
||||
tag_subscription.save
|
||||
sleep 0
|
||||
rescue Exception => x
|
||||
raise if Rails.env != "production"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user