Merge "[zmq] Remove ZmqSocket.close_linger attribute"
This commit is contained in:
commit
6bbe8d1ac6
@ -56,7 +56,7 @@ zmq_opts = [
|
|||||||
help='Name of this node. Must be a valid hostname, FQDN, or '
|
help='Name of this node. Must be a valid hostname, FQDN, or '
|
||||||
'IP address. Must match "host" option, if running Nova.'),
|
'IP address. Must match "host" option, if running Nova.'),
|
||||||
|
|
||||||
cfg.IntOpt('rpc_zmq_linger', default=-1,
|
cfg.IntOpt('zmq_linger', default=-1,
|
||||||
deprecated_group='DEFAULT',
|
deprecated_group='DEFAULT',
|
||||||
deprecated_name='rpc_cast_timeout',
|
deprecated_name='rpc_cast_timeout',
|
||||||
help='Number of seconds to wait before all pending '
|
help='Number of seconds to wait before all pending '
|
||||||
|
@ -46,12 +46,12 @@ class ZmqSocket(object):
|
|||||||
self.handle = context.socket(socket_type)
|
self.handle = context.socket(socket_type)
|
||||||
self.handle.set_hwm(high_watermark)
|
self.handle.set_hwm(high_watermark)
|
||||||
|
|
||||||
self.close_linger = -1
|
# Set linger period
|
||||||
if self.conf.oslo_messaging_zmq.rpc_zmq_linger >= 0:
|
linger = -1
|
||||||
|
if self.conf.oslo_messaging_zmq.zmq_linger >= 0:
|
||||||
# Convert seconds to milliseconds
|
# Convert seconds to milliseconds
|
||||||
self.close_linger = \
|
linger = self.conf.oslo_messaging_zmq.zmq_linger * 1000
|
||||||
self.conf.oslo_messaging_zmq.rpc_zmq_linger * 1000
|
self.handle.setsockopt(zmq.LINGER, linger)
|
||||||
self.handle.setsockopt(zmq.LINGER, self.close_linger)
|
|
||||||
|
|
||||||
# Put messages to only connected queues
|
# Put messages to only connected queues
|
||||||
self.handle.setsockopt(zmq.IMMEDIATE, 1 if immediate else 0)
|
self.handle.setsockopt(zmq.IMMEDIATE, 1 if immediate else 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user