[PATCH compass-ci 2/2] lib/sched_client.rb: obtain host port from the configuration file

25 Jan
2021
25 Jan
'21
3:10 p.m.
Signed-off-by: Xiao Shenwei <xiaoshenwei96@163.com> --- lib/sched_client.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/sched_client.rb b/lib/sched_client.rb index f1c095d..fec4b14 100644 --- a/lib/sched_client.rb +++ b/lib/sched_client.rb @@ -3,12 +3,11 @@ # frozen_string_literal: true require 'rest-client' +require_relative 'constants' # sched client class class SchedClient - HOST = (ENV.key?('SCHED_HOST') ? ENV['SCHED_HOST'] : '172.17.0.1') - PORT = (ENV.key?('SCHED_PORT') ? ENV['SCHED_PORT'] : 3000).to_i - def initialize(host = HOST, port = PORT) + def initialize(host = SCHED_HOST, port = SCHED_PORT) @host = host @port = port end -- 2.23.0
1545
Age (days ago)
1545
Last active (days ago)
0 comments
1 participants
participants (1)
-
Xiao Shenwei