discourse/app/controllers/admin/export_controller.rb

11 lines
450 B
Ruby
Raw Normal View History

2013-02-06 03:16:51 +08:00
class Admin::ExportController < Admin::AdminController
def create
unless Export.is_export_running? || Import.is_import_running?
2013-02-06 03:16:51 +08:00
job_id = Jobs.enqueue( :exporter, user_id: current_user.id )
render json: success_json.merge( job_id: job_id )
else
render json: failed_json.merge( message: "An #{Export.is_export_running? ? 'export' : 'import'} is currently running. Can't start a new export job right now.")
end
end
2013-02-07 23:45:24 +08:00
end