Skip to content
Snippets Groups Projects
Commit 8a777504 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Clear

parent 3dc1c421
No related branches found
No related tags found
No related merge requests found
......@@ -25,8 +25,15 @@ module Research::Hal
Research::Hal::Publication.set_callback :save, :after, :connect_and_sync_direct_sources
end
def self.clear_queue
# TODO
def self.clear_queue!
ids = []
Delayed::Job.find_each do |job|
if job.payload_object.method_name == :sync_indirect_object_with_git_without_delay &&
job.payload_object.args.first.is_a?(Research::Hal::Publication)
ids << job.id
end
end
Delayed::Job.where(id: ids).destroy_all
end
def self.parts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment