Skip to content

Commit

Permalink
Add importerror if gevent specified but not installed.
Browse files Browse the repository at this point in the history
Refs #759
  • Loading branch information
coleifer committed Aug 4, 2023
1 parent a8f85f5 commit 2dedbb3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions huey/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ def __init__(self, huey, workers=1, periodic=True, initial_delay=0.1,
'of 60, e.g. 1, 2, 3, 4, 5, 6, 10, 12...')

if worker_type == 'gevent': worker_type = WORKER_GREENLET
if worker_type == WORKER_GREENLET and Greenlet is None:
raise ImportError('Could not import gevent - is it installed?')
self.worker_type = worker_type # What process model are we using?

# Configure health-check and consumer main-loop attributes.
Expand Down

0 comments on commit 2dedbb3

Please sign in to comment.