Fix faulty API data format
This commit is contained in:

committed by
Sebastian Serth

parent
28f8de1a93
commit
c36ec447ff
@ -21,14 +21,14 @@ class Container
|
||||
|
||||
def copy_files(files)
|
||||
url = container_url + "/files"
|
||||
body = files.map{ |filename, content| { filename => content } }
|
||||
body = { files: files.map{ |filename, content| { filename: filename, content: content } } }
|
||||
Faraday.post(url, body.to_json, HEADERS)
|
||||
end
|
||||
|
||||
def copy_submission_files(submission)
|
||||
files = {}
|
||||
submission.collect_files.each do |file|
|
||||
files[file.name] = file.content
|
||||
files[file.name_with_extension] = file.content
|
||||
end
|
||||
copy_files(files)
|
||||
end
|
||||
|
@ -4,7 +4,7 @@ class ContainerConnection
|
||||
EVENTS = %i[start output exit stdout stderr].freeze
|
||||
|
||||
def initialize(url)
|
||||
@socket = Faye::WebSocket::Client.new(url, [], ping: 0.1)
|
||||
@socket = Faye::WebSocket::Client.new(url, [], ping: 5)
|
||||
|
||||
%i[open message error close].each do |event_type|
|
||||
@socket.on event_type do |event| __send__(:"on_#{event_type}", event) end
|
||||
|
Reference in New Issue
Block a user