Skip to content

Commit

Permalink
one_shot_execute adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
n3rada committed Feb 27, 2024
1 parent a67a3f3 commit aa709b7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions toboggan/src/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,21 @@ def execute(self, command: str, timeout: float = None, retry: bool = True) -> st

return result

def one_shot_execute(self, command: str) -> str:
def one_shot_execute(self, command: str = None) -> None:
"""Execute a command without returning nothing and with a fast timeout.
Args:
command (str): Command to be executed.
"""
if not command:
return

try:
if self.__os_handler is not None and self.__obfuscation:
command = self.__os_handler.prepare_command(command=command)
return self.__module.execute(command=command, timeout=1.5)
except:
pass
self.__module.execute(command=command, timeout=1.5)
except Exception:
return

def is_alive(self) -> bool:
"""
Expand Down

0 comments on commit aa709b7

Please sign in to comment.