日志问题

chromesetting
daiao 6 years ago
parent df57b58933
commit 1b2d3ebabb

@ -365,12 +365,7 @@ class ShixunsController < ApplicationController
end
def create
begin
@shixun = CreateShixunService.call(current_user, shixun_params, params)
rescue Exception => e
logger_error("shixun_create_error: #{e.message}")
tip_exception("创建实训失败!")
end
end
# 保存jupyter到版本库

@ -14,6 +14,7 @@ class CreateShixunService < ApplicationService
shixun.user_id = user.id
main_mirror = MirrorRepository.find params[:main_type]
sub_mirrors = MirrorRepository.where(id: params[:sub_type])
begin
ActiveRecord::Base.transaction do
shixun.save!
# 获取脚本内容
@ -43,6 +44,10 @@ class CreateShixunService < ApplicationService
end
return shixun
end
rescue => e
Rails.logger.error("shixun_create_error: #{e.message}")
raise("创建实训失败!")
end
end
private

Loading…
Cancel
Save