-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Michael J. Giarlo edited this page Jun 25, 2020
·
5 revisions
Welcome to the common-accessioning wiki!
This is code we used find jobs that were proliferating (they were all related to the desc-md step in the accessionWF)
druids = []
problematic_druids = []
Resque.redis.lrange("queue:accessionWF_default",0,-1).each do |job|
job = Resque::Job.decode(job)
druid = job['args'].first
job_class = job['class']
next unless job_class == "Robots::DorRepo::Accession::DescriptiveMetadata"
problematic_druids << druid if druids.include?(druid)
druids << druid
end
Resque::Job.destroy('accessionWF_default', 'Robots::DorRepo::Accession::DescriptiveMetadata', "druid:md898kw3185") # destroy all descMD jobs for a given druid in a named queue
Resque::Job.destroy('accessionWF_default', 'Robots::DorRepo::Accession::DescriptiveMetadata') # destroy all descMD jobs in the named queue