diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-02-26 18:35:32 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-02-26 18:35:32 +0100 |
| commit | 90ee943705e6ed373b778929c0bab94c6e34f674 (patch) | |
| tree | 533a3ed26fec69e07fa945617d5d0aae33047b99 /api.py | |
| parent | f54bb387475cd19e2f8d32cca131e2abb5eea8fd (diff) | |
| download | apigrabber-90ee943705e6ed373b778929c0bab94c6e34f674.tar.gz apigrabber-90ee943705e6ed373b778929c0bab94c6e34f674.zip | |
report job fails in queue
Diffstat (limited to 'api.py')
| -rw-r--r-- | api.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -69,8 +69,12 @@ class Worker(object): if jobid is None: raise LookupError("no jobs available") logging.debug("%s: starting job", jobid) - await self._execute_job(jobid, payload, priority) - await self._queue.finish(jobid) + try: + await self._execute_job(jobid, payload, priority) + await self._queue.finish(jobid) + except crawler.ApiError as error: + logging.warning("%s: failed", jobid) + await self._queue.fail(jobid, error.args[0]) logging.debug("%s: finished job", jobid) async def run(self): |
