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