fix for tag sub update

This commit is contained in:
albert
2013-04-02 17:01:22 -04:00
parent 9dd141ded4
commit eee7fa0edd
2 changed files with 11 additions and 8 deletions

View File

@@ -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

View File

@@ -128,6 +128,7 @@ class TagSubscription < ActiveRecord::Base
end end
def self.process_all def self.process_all
CurrentUser.scoped(User.admins.first, "127.0.0.1") do
find_each do |tag_subscription| find_each do |tag_subscription|
if $job_task_daemon_active != false && tag_subscription.creator.is_privileged? && tag_subscription.is_active? if $job_task_daemon_active != false && tag_subscription.creator.is_privileged? && tag_subscription.is_active?
begin begin
@@ -141,3 +142,4 @@ class TagSubscription < ActiveRecord::Base
end end
end end
end end
end