5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-29 15:16:21 +00:00
panel/db/migrate/20240313192134_fix_fetch_jobs.rb

21 lines
612 B
Ruby
Raw Normal View History

2024-03-13 19:27:33 +00:00
# frozen_string_literal: true
class FixFetchJobs < ActiveRecord::Migration[6.1]
def up
QueJob.where("last_error_message like '%ActiveJob::DeserializationError%'").find_each do |job|
job.error_count = 0
job.run_at = Time.now
2024-03-13 19:27:33 +00:00
job.args.first['arguments'].first['_aj_ruby2_keywords'].delete('object')
job.args.first['arguments'].first['_aj_ruby2_keywords'] << 'object_id'
object = job.args.first['arguments'].first.delete('object')['_aj_globalid']
job.args.first['arguments'].first['object_id'] = object.split('/').last
job.save
end
end
def down; end
end