Sha256: 3166dd6c71dc6ed0b7b8792bac45de9b662295eddbcd3964d9c1d8f9aee43430
Contents?: true
Size: 1.13 KB
Versions: 32
Compression:
Stored size: 1.13 KB
Contents
module PactBroker module DB class DeleteOverwrittenDataTask < ::Rake::TaskLib attr_accessor :database_connection attr_accessor :age_in_days def initialize &block rake_task &block end def rake_task &block namespace :pact_broker do namespace :db do desc "Delete overwritten pacts and verifications from database" task :delete_overwritten_data do | t, args | require 'pact_broker/db/delete_overwritten_data' require 'yaml' instance_eval(&block) options = {} if age_in_days options[:before] = (Date.today - age_in_days.to_i).to_datetime $stdout.puts "Deleting overwritten pact publications and verifications older than #{age_in_days} days" else $stdout.puts "Deleting overwritten pact publications and verifications" end report = PactBroker::DB::DeleteOverwrittenData.call(database_connection, options) $stdout.puts report.to_yaml end end end end end end end
Version data entries
32 entries across 32 versions & 1 rubygems