def __init__(self):
# if any jobs marked in run state when scheduler starts
# replace their state with X to mark that they have been shutdown
db = DAL(config.uri, auto_import=True, migrate=False, folder=config.dbdir)
myset = db(db.jobs.state == STATE_RUN)
myset.update(state=STATE_STOPPED)
db.commit()
self.sem = BoundedSemaphore(config.np)
self.mutex = Lock()
# set time zone
try:
os.environ['TZ'] = config.time_zone
time.tzset()
except: pass
评论列表
文章目录