mirror of
https://github.com/discourse/discourse.git
synced 2025-06-13 01:46:29 +08:00
Revert "FEATURE: stop running migrate to new scheme once done"
This reverts commit 2e346e6ea28616366a443c82f097a2c0b82135c4. Super seeded by 573ddcbbd014c0c91bf24871a0edc7d4f79a6152.
This commit is contained in:
@ -5,7 +5,7 @@ module Jobs
|
|||||||
sidekiq_options retry: false
|
sidekiq_options retry: false
|
||||||
|
|
||||||
def execute(args)
|
def execute(args)
|
||||||
return if !SiteSetting.migrate_to_new_scheme
|
return unless SiteSetting.migrate_to_new_scheme
|
||||||
|
|
||||||
# clean up failed uploads
|
# clean up failed uploads
|
||||||
Upload.where("created_at < ?", 1.hour.ago)
|
Upload.where("created_at < ?", 1.hour.ago)
|
||||||
@ -18,11 +18,6 @@ module Jobs
|
|||||||
# migrate uploads to new scheme
|
# migrate uploads to new scheme
|
||||||
problems = Upload.migrate_to_new_scheme(limit: 50)
|
problems = Upload.migrate_to_new_scheme(limit: 50)
|
||||||
|
|
||||||
if problems.length == 0
|
|
||||||
# This job is no longer needed skip it from now
|
|
||||||
SiteSetting.migrate_to_new_scheme = false
|
|
||||||
end
|
|
||||||
|
|
||||||
problems.each do |hash|
|
problems.each do |hash|
|
||||||
upload_id = hash[:upload].id
|
upload_id = hash[:upload].id
|
||||||
Discourse.handle_job_exception(hash[:ex], error_context(args, "Migrating upload id #{upload_id}", upload_id: upload_id))
|
Discourse.handle_job_exception(hash[:ex], error_context(args, "Migrating upload id #{upload_id}", upload_id: upload_id))
|
||||||
|
Reference in New Issue
Block a user