def _set_started(self, dt): if dt: value = int(time.mktime(dt.timetuple())) client.set(self.resq_start% self, value) else: client.delete(self.resq_start% self)
def register(self): client.sadd(self.resq_tasks, str(self)) client.set(self.resq_queue%self.task_id,self.queue) client.set(self.resq_name%self.task_id,self.task_name) client.set(self.resq_params%self.task_id,self.params) self.started = datetime.datetime.now()
def update_status(self,status): client.set(self.resq_status%self.task_id,status)
def _set_started(self, dt): if dt: key = int(time.mktime(dt.timetuple())) client.set(self.resq_worker_start % self.worker_id, key) else: client.delete(self.resq_worker_start % self.worker_id)