Move RunnerConnection into class Runner

The old approach was to require the runner connection. This did
not work anymore with Zeitwerk in Rails 6. @sebastian.serth and I
moved the Connection class in `lib` into the ActiveRecord class
`Runner`. This will also work with future changes like specific
error classes. Furthermore the config was fixed and simplified.

Co-authored-by: Sebastian Serth <Sebastian.Serth@hpi.de>
This commit is contained in:
Felix Auringer
2021-05-25 10:47:49 +02:00
committed by Sebastian Serth
parent 63d997a7e3
commit 8d968e01e6
4 changed files with 8 additions and 15 deletions

View File

@ -3,7 +3,7 @@
require 'faye/websocket/client'
require 'json_schemer'
class RunnerConnection
class Runner::Connection
EVENTS = %i[start output exit stdout stderr].freeze
BACKEND_OUTPUT_SCHEMA = JSONSchemer.schema(JSON.parse(File.read('lib/runner/backend-output.schema.json')))