Skip to content

Commit

Permalink
fix: remove print calls [python]
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed May 24, 2024
1 parent d3ad53f commit e7933df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions python/bullmq/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ async def _job(self):
while self._ok:
await asyncio.sleep(self.interval)
await self.callback(*self.args, **self.kwargs)
except Exception as ex:
print(ex)
except Exception:
pass

def stop(self):
self._ok = False
Expand Down
3 changes: 1 addition & 2 deletions python/bullmq/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def extract_result(job_task):
except Exception as e:
if not str(e).startswith('Connection closed by server'):
# lets use a simple-but-effective error handling:
# print error message and ignore the job
print("ERROR:", e)
# ignore the job
traceback.print_exc()

def get_parent_key(opts: dict):
Expand Down
5 changes: 0 additions & 5 deletions python/bullmq/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ async def run(self):

except Exception as e:
# This should never happen or we will have an endless loop
print("ERROR:", e)
traceback.print_exc()
return

Expand Down Expand Up @@ -200,13 +199,11 @@ async def processJob(self, job: Job, token: str):
return
except Exception as err:
try:
print("Error processing job", err)
if not self.forceClosing:
await job.moveToFailed(err, token)

self.emit("failed", job, err)
except Exception as err:
print("Error moving job to failed", err)
self.emit("error", err, job)
finally:
self.jobs.remove((job, token))
Expand All @@ -225,7 +222,6 @@ async def extendLocks(self):
# self.emit("error", "could not renew lock for job " + jobId)

except Exception as e:
print("Error renewing locks", e)
traceback.print_exc()

async def runStalledJobsCheck(self):
Expand All @@ -238,7 +234,6 @@ async def runStalledJobsCheck(self):
self.emit("stalled", jobId)

except Exception as e:
print("Error checking stalled jobs", e)
self.emit('error', e)

async def close(self, force: bool = False):
Expand Down

0 comments on commit e7933df

Please sign in to comment.