fixes for tag subs

This commit is contained in:
albert
2013-04-03 14:36:28 -04:00
parent 786655ae39
commit 3a96bb0811
4 changed files with 3 additions and 6 deletions

View File

@@ -82,6 +82,6 @@ class Cache
end end
def self.sanitize(key) def self.sanitize(key)
key.gsub(/\W/) {|x| "%#{x.ord}"}.slice(0, 240) key.gsub(/\W/) {|x| "%#{x.ord}"}.slice(0, 230)
end end
end end

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)
TagSubscription.process_all
prune_ad_hits prune_ad_hits
end end

View File

@@ -51,7 +51,7 @@ class TagSubscription < ActiveRecord::Base
end end
def is_active? def is_active?
creator.last_logged_in_at && creator.last_logged_in_at > 1.year.ago creator.last_logged_in_at && creator.last_logged_in_at > 3.months.ago
end end
def editable_by?(user) def editable_by?(user)

View File

@@ -1,9 +1,5 @@
set :output, "/var/log/whenever.log" set :output, "/var/log/whenever.log"
every 4.hours do
runner "TagSubscription.process_all"
end
every 1.hour do every 1.hour do
runner "UploadErrorChecker.new.check!" runner "UploadErrorChecker.new.check!"
end end