mirror of
https://github.com/discourse/discourse.git
synced 2025-04-09 04:50:43 +08:00
FIX: do not use scheduler for uploading csv file for invite
Since the bulk invite process already happens in a dedicated Sidekiq job
This commit is contained in:
parent
7590128d38
commit
b9835cc392
@ -165,7 +165,6 @@ class InvitesController < ApplicationController
|
|||||||
name = params[:name] || File.basename(file.original_filename, ".*")
|
name = params[:name] || File.basename(file.original_filename, ".*")
|
||||||
extension = File.extname(file.original_filename)
|
extension = File.extname(file.original_filename)
|
||||||
|
|
||||||
Scheduler::Defer.later("Upload CSV") do
|
|
||||||
begin
|
begin
|
||||||
data = if extension.downcase == ".csv"
|
data = if extension.downcase == ".csv"
|
||||||
path = Invite.create_csv(file, name)
|
path = Invite.create_csv(file, name)
|
||||||
@ -178,7 +177,6 @@ class InvitesController < ApplicationController
|
|||||||
failed_json.merge(errors: [I18n.t("bulk_invite.error")])
|
failed_json.merge(errors: [I18n.t("bulk_invite.error")])
|
||||||
end
|
end
|
||||||
MessageBus.publish("/uploads/csv", data.as_json, user_ids: [current_user.id])
|
MessageBus.publish("/uploads/csv", data.as_json, user_ids: [current_user.id])
|
||||||
end
|
|
||||||
|
|
||||||
render json: success_json
|
render json: success_json
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user