-
Notifications
You must be signed in to change notification settings - Fork 22
/
jobexecute.py
35 lines (25 loc) · 862 Bytes
/
jobexecute.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
# coding=utf-8
import time
import logging
import traceback
from ProcessHandler.lib.log import setup_file_logging
from ProcessHandler.lib.workers.sync import SyncWorker
class JobExecute(SyncWorker):
LOGGER_NAME = "jobexecute"
def __init__(self, cfg, file_logger=None, ppid=None, sockets=None):
SyncWorker.__init__(self, cfg, file_logger, ppid)
setup_file_logging(self.LOGGER_NAME, self.cfg.log_file)
self.logger = logging.getLogger(self.LOGGER_NAME)
def setup(self):
super(JobExecute, self).setup()
def init_process(self):
super(JobExecute, self).init_process()
def stop(self):
super(JobExecute, self).stop()
def handle_request(self):
while 1:
print 'go....'
self.logger.info('go...')
time.sleep(1.5)
if __name__ == '__main__':
pass