mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #10325 from s0undt3ch/hotfix/revert-reuse-channels
revert reuse channels
This commit is contained in:
commit
e0467c253d
@ -5,14 +5,9 @@ Encapsulate the different transports available to Salt. Currently this is only
|
||||
|
||||
import salt.payload
|
||||
import salt.auth
|
||||
import os
|
||||
|
||||
|
||||
class Channel(object):
|
||||
# store a cache of the channels so a single pid can re-use a connection.
|
||||
# This needs to be per pid as when you fork you keep the original memory
|
||||
# space and we can't control currency across pids
|
||||
channel_cache = {}
|
||||
|
||||
@staticmethod
|
||||
def factory(opts, **kwargs):
|
||||
# Default to ZeroMQ for now
|
||||
@ -24,10 +19,7 @@ class Channel(object):
|
||||
ttype = opts['pillar']['master']['transport_type']
|
||||
|
||||
if ttype == 'zeromq':
|
||||
pid = os.getpid()
|
||||
if pid not in Channel.channel_cache:
|
||||
Channel.channel_cache[pid] = ZeroMQChannel(opts, **kwargs)
|
||||
return Channel.channel_cache[pid]
|
||||
return ZeroMQChannel(opts, **kwargs)
|
||||
else:
|
||||
raise Exception("Channels are only defined for ZeroMQ")
|
||||
# return NewKindOfChannel(opts, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user