mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
Initial release of Discourse
This commit is contained in:
10
app/controllers/admin/export_controller.rb
Normal file
10
app/controllers/admin/export_controller.rb
Normal file
@ -0,0 +1,10 @@
|
||||
class Admin::ExportController < Admin::AdminController
|
||||
def create
|
||||
unless Export.is_export_running? or Import.is_import_running?
|
||||
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
|
||||
end
|
Reference in New Issue
Block a user