-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdaemon.py
More file actions
27 lines (22 loc) · 721 Bytes
/
Copy pathdaemon.py
File metadata and controls
27 lines (22 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import time
import subprocess
import os
import sys
def main():
base_dir = os.path.dirname(os.path.abspath(__file__))
if sys.platform.startswith('win'):
script_name = "run_generator.bat"
elif sys.platform.startswith('darwin'):
script_name = "run_generator.command"
else:
script_name = "run_generator.sh"
script_path = os.path.join(base_dir, script_name)
while True:
try:
subprocess.run([script_path], capture_output=True, shell=sys.platform.startswith('win'))
except Exception as e:
pass
# Sync interval in seconds (default 900s = 15 minutes)
time.sleep(900)
if __name__ == "__main__":
main()