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
29
29
# A custom RunOnMachine error exception
30
30
class RunOnMachineError < AutoHCKError ; end
31
31
32
+ # A custom RunOnStudio error exception
33
+ class RunOnStudioError < AutoHCKError ; end
34
+
32
35
# A custom UploadToMachineError error exception
33
36
class UploadToMachineError < AutoHCKError ; end
34
37
@@ -160,6 +163,23 @@ def delete_machine(machine, pool)
160
163
end
161
164
end
162
165
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
+
163
183
def run_on_machine ( machine , desc , cmd )
164
184
retries ||= 0
165
185
ret = act_with_tools { _1 . run_on_machine ( machine , cmd ) }
You can’t perform that action at this time.
0 commit comments