mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 15:46:21 +00:00
fixup! fix: serializar correctamente
This commit is contained in:
parent
56c583e0f4
commit
ad9f9c3d61
2 changed files with 25 additions and 0 deletions
5
app/models/que_job.rb
Normal file
5
app/models/que_job.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'que/active_record/model'
|
||||||
|
|
||||||
|
class QueJob < Que::ActiveRecord::Model; end
|
20
db/migrate/20240313192134_fix_fetch_jobs.rb
Normal file
20
db/migrate/20240313192134_fix_fetch_jobs.rb
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# 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
|
||||||
|
|
||||||
|
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
|
Loading…
Reference in a new issue