Skip to content

Commit

Permalink
Merge pull request #873 from concerto/871_purge_pa
Browse files Browse the repository at this point in the history
Added Activity model, ConcertoConfig entry, and cron entry to achieve #871
  • Loading branch information
augustf committed Feb 3, 2014
2 parents c956341 + 13c55e9 commit 1e2905f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/initializers/02-concerto_config.rb
Expand Up @@ -49,6 +49,7 @@
ConcertoConfig.make_concerto_config("system_time_zone", 'Eastern Time (US & Canada)', :value_type => "timezone", :category => 'System')
ConcertoConfig.make_concerto_config("config_last_updated", "0", :value_type => "integer", :hidden => "true", :category => 'System')
ConcertoConfig.make_concerto_config("http_proxy_settings", "", :value_type => "string", :category => 'System', :description => 'http://username:password@hostname:port')
ConcertoConfig.make_concerto_config("keep_activity_log", "90", :value_type => "integer", :value_default => "90", :category => 'System', :description => 'Days to keep activity log for (where 0 is forever)')

end

Expand Down
11 changes: 11 additions & 0 deletions lib/cron.rb
Expand Up @@ -20,4 +20,15 @@ module Clockwork
every(1.day, 'Deny Expired Content Submissions') do
Submission.delay.deny_old_expired
end

if RUBY_VERSION >= "1.9"
every(1.day, 'Remove old public activity entries') do
unless ConcertoConfig[:keep_activity_log].to_i == 0
activities = PublicActivity::Activity.where("created_at > :days", {:days => ConcertoConfig[:keep_activity_log].to_i.days.ago}).destroy_all
end
end
end

end


0 comments on commit 1e2905f

Please sign in to comment.