Skip to content

Commit

Permalink
Added delay when reopening
Browse files Browse the repository at this point in the history
  • Loading branch information
PenguinDevs committed Jun 8, 2023
1 parent d25f1d0 commit ba726f3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,10 @@ def get_appdata_location(self) -> None:
self.appdata_path = path

def reopen(self, *args, **kwargs) -> None:
logging.info('Reopening ValoRPC...')
os.system(f'start {os.path.join(self.application_path, "ValoRPC.exe")}')
path = os.path.join(self.application_path, "ValoRPC.exe")
delay = 5
logging.info(f'Reopening ValoRPC from {path} in {delay} seconds')
os.system(f'timeout /t {delay} & start {path}')
exit(0)

if __name__ == '__main__':
Expand Down

0 comments on commit ba726f3

Please sign in to comment.