Removed dependency from kombu.five
Replace usage of five.monotonic with simple time.time(). Closes-bug: #1305784 Change-Id: I138d034ef0677f8ecb73cb978860f8d0a0a4df4e
This commit is contained in:
parent
9edc16767e
commit
f36d8bea5d
@ -15,10 +15,10 @@
|
|||||||
|
|
||||||
import collections
|
import collections
|
||||||
import socket
|
import socket
|
||||||
|
import time
|
||||||
|
|
||||||
from eventlet import patcher
|
from eventlet import patcher
|
||||||
kombu = patcher.import_patched('kombu')
|
kombu = patcher.import_patched('kombu')
|
||||||
five = patcher.import_patched('kombu.five')
|
|
||||||
from muranoapi.common.messaging import message
|
from muranoapi.common.messaging import message
|
||||||
|
|
||||||
|
|
||||||
@ -51,14 +51,14 @@ class Subscription(object):
|
|||||||
elapsed = 0.0
|
elapsed = 0.0
|
||||||
remaining = timeout
|
remaining = timeout
|
||||||
while True:
|
while True:
|
||||||
time_start = five.monotonic()
|
time_start = time.time()
|
||||||
if self._buffer:
|
if self._buffer:
|
||||||
return self._buffer.pop()
|
return self._buffer.pop()
|
||||||
try:
|
try:
|
||||||
self._connection.drain_events(timeout=timeout and remaining)
|
self._connection.drain_events(timeout=timeout and remaining)
|
||||||
except socket.timeout:
|
except socket.timeout:
|
||||||
return None
|
return None
|
||||||
elapsed += five.monotonic() - time_start
|
elapsed += time.time() - time_start
|
||||||
remaining = timeout and timeout - elapsed or None
|
remaining = timeout and timeout - elapsed or None
|
||||||
|
|
||||||
def _receive(self, message_data, message):
|
def _receive(self, message_data, message):
|
||||||
|
Loading…
Reference in New Issue
Block a user