示例#1
0
文件: job.py 项目: MShaffar19/mtq
    def new(cls, name, tags, priority, execute, timeout):

        n = now()
        no = mktime(n.timetuple())
        return {
            'qname': name,
            'tags': tags,
            'process_after': n,
            'priority': priority,
            'execute': execute,
            'enqueued_at': n,
            'enqueued_at_': no,
            'started_at': nulltime(),
            'started_at_': 0.0,
            'finished_at': nulltime(),
            'finished_at_': 0.0,
            'processed': False,
            'failed': False,
            'finished': False,
            'timeout': timeout,
            'worker_id': ObjectId('000000000000000000000000'),
        }
示例#2
0
文件: job.py 项目: B-Rich/mtq
 def new(cls, name, tags, priority, execute, timeout):
     
     n = now()
     no = mktime(n.timetuple())
     return {
            'qname':name,
            'tags': tags,
            'process_after': n,
            'priority': priority,
            
            'execute': execute,
            'enqueued_at': n,
            'enqueued_at_': no,
            'started_at': nulltime(),
            'started_at_': 0.0,
            'finished_at': nulltime(),
            'finished_at_': 0.0,
            'processed': False,
            'failed': False,
            'finished': False,
            'timeout':timeout,
            'worker_id': ObjectId('000000000000000000000000'),
            }
示例#3
0
文件: worker.py 项目: MShaffar19/mtq
 def last_check_in(self):
     'last check in time'
     return self.doc.get('check-in', nulltime())