Skip to content

Commit

Permalink
Fix for celery#1847 cannot drain events for Redis. Closes celery#2827
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Sep 29, 2015
1 parent fe33f16 commit ba75fa0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion celery/worker/loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def asynloop(obj, connection, consumer, blueprint, hub, qos,
# consumer.consume() may have prefetched up to our
# limit - drain an event so we are in a clean state
# prior to starting our event loop.
connection.drain_events()
if connection.transport.driver_type == 'amqp':
hub.call_soon(connection.drain_events)

# FIXME: Use loop.run_forever
# Tried and works, but no time to test properly before release.
Expand Down

0 comments on commit ba75fa0

Please sign in to comment.