mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:43:40 +08:00
6c91148db8
* DEV: Implement uploads command entrypoint - Setup Thor UploadsCommand for CLI - First pass at modularizing various parts of the exising `uploads_import` script * DEV: First attempt at modularizing missing uploads fixer task Move missing upload fix to a dedicated uploads task implementation unit * DEV: First attempt at modularizing missing uploads uploader task Move uploader to a dedicated uploads task implementation unit * DEV: First attempt at modularizing missing uploads optimizer task Move optimizer to a dedicated uploads task implementation unit * DEV: Various follow up fixes to get optimization working - Start threads early - Improve "log" message formatting - Add missing `copy_to_tempfile` method on "uploader" task * DEV: Refactor a bit more Deduplicate and move most of threading premitives to base task as-is * DEV: Remove redundant condition in uploads db migration * DEV: More deduplication Move task retry logic to base class and tidy up other implementation details carried over from the existing script
24 lines
507 B
Ruby
Executable File
24 lines
507 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
require "thor"
|
|
require_relative "../lib/migrations"
|
|
|
|
module Migrations
|
|
load_rails_environment
|
|
configure_zeitwerk
|
|
enable_i18n
|
|
|
|
class CommandLineInterface < Thor
|
|
include ::Migrations::CLI::ConvertCommand
|
|
include ::Migrations::CLI::ImportCommand
|
|
include ::Migrations::CLI::UploadCommand
|
|
|
|
def self.exit_on_failure?
|
|
true
|
|
end
|
|
end
|
|
|
|
Dir.chdir(Rails.root) { CommandLineInterface.start } # rubocop:disable Discourse/NoChdir
|
|
end
|