-
Notifications
You must be signed in to change notification settings - Fork 4
/
runAll.py
37 lines (31 loc) · 1.04 KB
/
runAll.py
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
28
29
30
31
32
33
34
35
36
37
import subprocess
import threading
def run_command(command):
try:
print("Executing command: {}".format(command))
return_code = subprocess.call(command, shell=True)
if return_code != 0:
raise subprocess.CalledProcessError(return_code, command)
print("Command succeeded: {}".format(command))
except subprocess.CalledProcessError as e:
print("Error executing command {}: {}".format(command, e))
# List of commands to run in parallel
commands = [
#"cd chat && node index.js",
"cd knowledgeBase && node index.js",
"cd logging && node index.js",
"cd notifications && node index.js",
"cd tickets && node index.js",
"cd users && node index.js",
"cd bot && node index.js",
"cd middleware && node index.js",
#"cd BackUp && node index.js",
]
threads = []
for command in commands:
thread = threading.Thread(target=run_command, args=(command,))
thread.start()
threads.append(thread)
# Wait for all threads to complete
for thread in threads:
thread.join()