discogs / pymongo-job-queue

MongoDB-based message queue
https://pypi.python.org/pypi/pymjq
MIT License
19 stars 20 forks source link

Add Silent Mode for JobQueue #8

Closed accraze closed 7 years ago

accraze commented 7 years ago

When you use the job queue, it prints waiting! every 5 seconds if there are no jobs in the queue. https://github.com/discogs/pymongo-job-queue/blob/master/pymjq/jobqueue.py#L95

It would be awesome to have a silent kwarg on JobQueue initialization so we don't see the waiting! message clogging up the terminal in development.

Maybe something like:

from pymongo import MongoClient
from pymjq import JobQueue
client = MongoClient("localhost", 27017)
db = client.job_queue
jobqueue = JobQueue(db, silent=True)
enriquegh commented 7 years ago

I'll give this a shot

accraze commented 7 years ago

go for it @enriquegh, let me know if you need any help!

shanmbic commented 7 years ago

Hi Guys, I added the 'silent' keyword , which is set to False as default . While waiting for new jobs, if it is set to True it will not print 'waiting'. Am I missing something here ?? Pull request : https://github.com/discogs/pymongo-job-queue/pull/9

accraze commented 7 years ago

Looks good @shanmbic thanks again!

Closed by #9