Skip to content

Commit ac5620d

Browse files
committed
Apply TIMEOUT_SCALE twice when needed
When TIMEOUT_SCALE is set for a worker and the command line also provides the value, apply both.
1 parent faa0e5c commit ac5620d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/OpenQA/Worker/Job.pm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,13 @@ sub start ($self) {
222222
# update settings received from web UI with worker-specific stuff
223223
my $worker = $self->worker;
224224
my $global_worker_settings = $worker->settings->global_settings;
225+
# TIMEOUT_SCALE: apply the factors from both the job settings and the worker settings
226+
my $timeout_scale = $global_worker_settings->{TIMEOUT_SCALE} // 1;
227+
$timeout_scale *= $job_settings->{TIMEOUT_SCALE} // 1;
225228
@{$job_settings}{keys %$global_worker_settings} = values %$global_worker_settings;
229+
if ($timeout_scale != 1) {
230+
$job_settings->{TIMEOUT_SCALE} = $timeout_scale;
231+
}
226232

227233
# set OPENQA_HOSTNAME environment variable (likely not used anywhere but who knows for sure)
228234
my $client = $self->client;

0 commit comments

Comments
 (0)