def test_push(self): self.resq.push('pushq', 'content-newqueue') self.resq.push('pushq', 'content2-newqueue') assert self.redis.llen('resque:queue:pushq') == 2 assert self.redis.lindex('resque:queue:pushq', 0) == ResQ.encode('content-newqueue') assert self.redis.lindex('resque:queue:pushq', 1) == ResQ.encode('content2-newqueue')
def save(self, resq): data = { 'failed_at' : str(datetime.datetime.now()), 'payload' : self._payload, 'error' : self._parse_message(self._exception), 'backtrace' : self._parse_traceback(self._traceback), 'queue' : self._queue } data = ResQ.encode(data) resq.redis.push('failed', data)
def save(self, resq=None): if not resq: resq = ResQ() data = { "failed_at": str(datetime.datetime.now()), "payload": self._payload, "error": self._parse_message(self._exception), "backtrace": self._parse_traceback(self._traceback), "queue": self._queue, } if self._worker: data["worker"] = self._worker data = ResQ.encode(data) resq.redis.push("resque:failed", data)
def save(self, resq=None): if not resq: resq = ResQ() data = { 'failed_at' : str(datetime.datetime.now()), 'payload' : self._payload, 'error' : self._parse_message(self._exception), 'backtrace' : self._parse_traceback(self._traceback), 'queue' : self._queue } if self._worker: data['worker'] = self._worker data = ResQ.encode(data) resq.redis.rpush('resque:failed', data)
def save(self, resq=None): """Saves the failed Job into a "failed" Redis queue preserving all its original enqueud info.""" if not resq: resq = ResQ() data = { "failed_at": int(time.mktime(datetime.datetime.now().timetuple())), "payload": self._payload, "error": self._parse_message(self._exception), "backtrace": self._parse_traceback(self._traceback), "queue": self._queue, } if self._worker: data["worker"] = self._worker data = ResQ.encode(data) resq.redis.rpush("resque:failed", data)
def save(self, resq=None): """Saves the failed Job into a "failed" Redis queue preserving all its original enqueud info.""" if not resq: resq = ResQ() data = { 'failed_at': int(time.mktime(datetime.datetime.now().timetuple())), 'payload': self._payload, 'error': self._parse_message(self._exception), 'backtrace': self._parse_traceback(self._traceback), 'queue': self._queue } if self._worker: data['worker'] = self._worker data = ResQ.encode(data) resq.redis.rpush('resque:failed', data)
def save(self, resq=None): """Saves the failed Job into a "failed" Redis queue preserving all its original enqueud info.""" if not resq: resq = ResQ() data = { 'failed_at' : int(time.mktime(datetime.datetime.now().timetuple())), 'payload' : self._payload, 'error' : self._parse_message(self._exception), 'backtrace' : self._parse_traceback(self._traceback), 'queue' : self._queue } if self._worker: data['worker'] = self._worker data = ResQ.encode(data) resq.redis.rpush('resque:failed', data)
def save(self, resq=None): """Saves the failed Job into a "failed" Redis queue preserving all its original enqueud info.""" if not resq: resq = ResQ() data = { 'failed_at': datetime.datetime.now().strftime('%Y/%m/%d %H:%M:%S'), 'payload': self._payload, 'exception': self._exception.__class__.__name__, 'error': self._parse_message(self._exception), 'backtrace': self._parse_traceback(self._traceback), 'queue': self._queue } if self._worker: data['worker'] = self._worker data = ResQ.encode(data) resq.redis.rpush('resque:failed', data)
def save(self, resq=None): """Saves the failed Job into a "failed" Redis queue preserving all its original enqueud info.""" if not resq: resq = ResQ() data = { 'failed_at' : datetime.datetime.now().strftime('%Y/%m/%d %H:%M:%S'), 'payload' : self._payload, 'exception' : self._exception.__class__.__name__, 'error' : self._parse_message(self._exception), 'backtrace' : self._parse_traceback(self._traceback), 'queue' : self._queue } if self._worker: data['worker'] = self._worker data = ResQ.encode(data) resq.redis.rpush('resque:failed', data)
def save(self, resq=None): """Saves the failed Job into a "failed" Redis queue preserving all its original enqueud info.""" if not resq: resq = ResQ() data = { "failed_at": datetime.datetime.now().strftime("%Y/%m/%d %H:%M:%S"), "payload": self._payload, "exception": self._exception.__class__.__name__, "error": self._parse_message(self._exception), "backtrace": self._parse_traceback(self._traceback), "queue": self._queue, } if self._worker: data["worker"] = self._worker data = ResQ.encode(data) resq.redis.rpush("resque:failed", data)
def test_push(self): self.resq.push('pushq','content-newqueue') self.resq.push('pushq','content2-newqueue') assert self.redis.llen('resque:queue:pushq') == 2 assert self.redis.lindex('resque:queue:pushq', 0) == ResQ.encode('content-newqueue') assert self.redis.lindex('resque:queue:pushq', 1) == ResQ.encode('content2-newqueue')
def test_push(self): self.resq.push("pushq", "content-newqueue") self.resq.push("pushq", "content2-newqueue") assert self.redis.llen("resque:queue:pushq") == 2 assert self.redis.lindex("resque:queue:pushq", 0) == ResQ.encode("content-newqueue") assert self.redis.lindex("resque:queue:pushq", 1) == ResQ.encode("content2-newqueue")