Remove unused SubmissionsController#stop action

This commit is contained in:
Sebastian Serth
2021-04-07 17:45:38 +02:00
parent ed83e8ea52
commit 1e5a9b0825
5 changed files with 5 additions and 51 deletions

View File

@ -163,12 +163,11 @@ CodeOceanEditorSubmissions = {
runSubmission: function (submission) {
//Run part starts here
$('#stop').data('url', submission.stop_url);
this.running = true;
this.showSpinner($('#run'));
$('#score_div').addClass('d-none');
this.toggleButtonStates();
var url = submission.run_url.replace(this.FILENAME_URL_PLACEHOLDER, CodeOceanEditor.active_file.filename.replace(/#$/,'')); // remove # if it is the last character, this is not part of the filename and just an anchor
const url = submission.run_url.replace(this.FILENAME_URL_PLACEHOLDER, CodeOceanEditor.active_file.filename.replace(/#$/,'')); // remove # if it is the last character, this is not part of the filename and just an anchor
this.initializeSocketForRunning(url);
},

View File

@ -412,16 +412,6 @@ class SubmissionsController < ApplicationController
def statistics
end
def stop
Rails.logger.debug('stopping submission ' + @submission.id.to_s)
container = Docker::Container.get(params[:container_id])
DockerClient.destroy_container(container)
rescue Docker::Error::NotFoundError => error
Sentry.capture_exception(error)
ensure
head :ok
end
def test
hijack do |tubesock|
unless EventMachine.reactor_running? && EventMachine.reactor_thread.alive?

View File

@ -1,7 +1,6 @@
json.extract! @submission, :id, :files
json.download_url download_submission_path(@submission, format: :json)
json.score_url score_submission_path(@submission, format: :json)
json.stop_url stop_submission_path(@submission, format: :json)
json.download_file_url download_file_submission_path(@submission, 'a.', format: :json).gsub(/a\.\.json$/, '{filename}.json')
json.render_url render_submission_path(@submission, 'a.', format: :json).gsub(/a\.\.json$/, '{filename}.json')
json.run_url run_submission_path(@submission, 'a.', format: :json).gsub(/a\.\.json$/, '{filename}.json')