Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

only clean 'infochimps' topic events by default

  • Loading branch information...
commit 8039e9b2bb39b3794b3cca8c993ad227b4bc44bf 1 parent 3e8290f
@dhruvbansal dhruvbansal authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 cookbooks/vayacondios/recipes/cleaner.rb
View
5 cookbooks/vayacondios/recipes/cleaner.rb
@@ -12,8 +12,11 @@
mongo = discover(:mongodb, :server)
Chef::Log.warn("No MongoDB database is available to clean (didn't set and couldn't discover node[:vayacondios][:mongodb][:database])") unless node[:vayacondios][:mongodb][:database]
+# FIXME -- for now we're hard-coding to delete all events on the
+# 'infochimps' topic from the last hour. This needs to be more
+# generally configurable if it is included at all.
cron "Clean old Vayacondios events" do
minute "*/10"
path "/bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/local/sbin"
- command "cd #{node[:vayacondios][:home_dir]} && bundle exec vcd-clean --host=#{mongo.private_ip} --port=#{mongo.ports[:http][:port]} --database=#{node[:vayacondios][:mongodb][:database]} --upto=#{node[:vayacondios][:cleaner][:max_age]} >> #{node[:vayacondios][:log_dir]}/cleaner.log 2>&1"
+ command "cd #{node[:vayacondios][:home_dir]} && bundle exec vcd-clean --host=#{mongo.private_ip} --port=#{mongo.ports[:http][:port]} --database=#{node[:vayacondios][:mongodb][:database]} --upto=#{node[:vayacondios][:cleaner][:max_age]} --matching='^infochimps\..*\.events$' >> #{node[:vayacondios][:log_dir]}/cleaner.log 2>&1"
end
Please sign in to comment.
Something went wrong with that request. Please try again.