Prevent parallel execution of run and test during RfC creation
* Otherwise, the output of both might be mixed and saved incorrectly for the RfC
This commit is contained in:
@ -117,12 +117,10 @@ class RequestForCommentsController < ApplicationController
|
|||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @request_for_comment.save
|
if @request_for_comment.save
|
||||||
# create thread here and execute tests. A run is triggered from the frontend and does not need to be handled here.
|
# execute the tests here and wait until they finished.
|
||||||
Thread.new do
|
# As the same runner is used for the score and test run, no parallelization is possible
|
||||||
switch_locale { @request_for_comment.submission.calculate_score }
|
# A run is triggered from the frontend and does not need to be handled here.
|
||||||
ensure
|
@request_for_comment.submission.calculate_score
|
||||||
ActiveRecord::Base.connection_pool.release_connection
|
|
||||||
end
|
|
||||||
format.json { render :show, status: :created, location: @request_for_comment }
|
format.json { render :show, status: :created, location: @request_for_comment }
|
||||||
else
|
else
|
||||||
format.html { render :new }
|
format.html { render :new }
|
||||||
|
Reference in New Issue
Block a user