Skip to content

Commit

Permalink
Add rake task to ensure self-destruct is scheduled
Browse files Browse the repository at this point in the history
  • Loading branch information
c-lliope committed Sep 24, 2016
1 parent 9121aca commit c73f478
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ Rails.application.load_tasks
task(:default).clear
task default: [:spec]

task ensure_self_destruct_is_scheduled: [:environment] do
include ApplicationHelper

if Post.any? && Delayed::Job.none? { |job| job.handler =~ /SelfDestruct/ }
SelfDestruct.new.delay(run_at: expiration_time).attempt
end
end

if defined? RSpec
task(:spec).clear
RSpec::Core::RakeTask.new(:spec) do |t|
Expand Down

0 comments on commit c73f478

Please sign in to comment.