File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ class RestartMachineError < AutoHCKError; end
2929 # A custom RunOnMachine error exception
3030 class RunOnMachineError < AutoHCKError ; end
3131
32+ # A custom RunOnStudio error exception
33+ class RunOnStudioError < AutoHCKError ; end
34+
3235 # A custom UploadToMachineError error exception
3336 class UploadToMachineError < AutoHCKError ; end
3437
@@ -160,6 +163,23 @@ def delete_machine(machine, pool)
160163 end
161164 end
162165
166+ def run_on_studio ( command )
167+ retries ||= 0
168+ ret = act_with_tools { _1 . run_on_studio ( command ) }
169+
170+ return ret if ret
171+
172+ e_message = "Running command (#{ command } ) on studio failed"
173+ raise RunOnStudioError , e_message
174+ rescue RunOnStudioError => e
175+ @logger . warn ( e . message )
176+ raise unless ( retries += 1 ) < ACTION_RETRIES
177+
178+ sleep ACTION_RETRY_SLEEP
179+ @logger . info ( "Trying again to run command (#{ command } ) on studio" )
180+ retry
181+ end
182+
163183 def run_on_machine ( machine , desc , cmd )
164184 retries ||= 0
165185 ret = act_with_tools { _1 . run_on_machine ( machine , cmd ) }
You can’t perform that action at this time.
0 commit comments