-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOtherServices.py
More file actions
76 lines (61 loc) · 2.17 KB
/
Copy pathOtherServices.py
File metadata and controls
76 lines (61 loc) · 2.17 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright (c) 2025 Uddipan Bagchi. All rights reserved.
# See LICENSE in the project root for license information.package com.costheta.cortexa.action
import multiprocessing
import sys
from multiprocessing import Process
from utils.IPUtils import checkIP
# Set spawn method explicitly for Windows compatibility
if "win32" in sys.platform:
multiprocessing.set_start_method('spawn', force=True)
else:
multiprocessing.set_start_method('fork', force=True)
from Configuration import *
CosThetaConfigurator.getInstance()
from utils.CosThetaPrintUtils import *
def startTheWebServiceEndpoints():
from endpoints.AutoCompanyWebService import startWebService
startWebService()
def startTheMIService():
from endpoints.AutoCompany_MI_Light import startMIServer
startMIServer()
def startTheShowScreenService():
from endpoints.ShowScreen import startTheShowScreenService
startTheShowScreenService()
def threadToKeepProgramFromShuttingDown():
while True:
try:
time.sleep(10)
printBoldBlue(f"Services are alive")
except:
pass
def main():
# global showSplash
try:
P1 = Process(target=startTheWebServiceEndpoints, args=())
P1.start()
time.sleep(3)
printBoldBlue("Started the WebService Endpoints")
except:
printBoldRed("Could not start the WebService Endpoints")
try:
P2 = Process(target=startTheMIService, args=())
P2.start()
time.sleep(1)
printBoldBlue("Started the MI Dashboard Service")
except:
printBoldRed("Could not start the MI Dashboard Service")
try:
P3 = Process(target=startTheShowScreenService, args=())
P3.start()
time.sleep(1)
printBoldBlue("Started the Show Screen Service")
except:
printBoldRed("Could not start the Show Screen Service")
keepAliveThread = threading.Thread(name="Stop Monitoring Thread", target=threadToKeepProgramFromShuttingDown,
args=(),
daemon=True)
keepAliveThread.start()
keepAliveThread.join()
if __name__ == '__main__':
main()
sys.exit(0)