Skip to content

Commit c6096ed

Browse files
committed
now running the selected main method
1 parent a11d721 commit c6096ed

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

modules/service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ def __init__(self, service_name, service_conf):
77
self.name = service_name
88
self.directory = service_conf['directory']
99
self.keepAlive = service_conf['restart']
10+
self.main_method = service_conf['main_method']
1011
self.thread = Thread(target=self.run, args=[])
1112

1213
def setId(self, id):
1314
self.id = id
1415

1516
def run(self):
1617
import_module("run.%s.%s" %(self.directory, self.name))
17-
command = "run.%s.%s.main" %(self.directory, self.name)
18+
command = "run.%s.%s.%s" %(self.directory, self.name, self.main_method)
1819
if self.keepAlive:
1920
while self.keepAlive:
2021
eval(command)()

services/hello_world.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)