Skip to content

Commit

Permalink
Reset channel in pycue when setting host or facility (#222)
Browse files Browse the repository at this point in the history
* Issue #220, call resetChannel when setting host or facility on opencue.Cuebot
  • Loading branch information
Greg Denton authored Feb 26, 2019
1 parent 86658b4 commit cef1484
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pycue/opencue/cuebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ def closeChannel():
del Cuebot.RpcChannel
Cuebot.RpcChannel = None

@staticmethod
def resetChannel():
"""Close and reopen the gRPC channel."""
Cuebot.closeChannel()
Cuebot.setChannel()

@staticmethod
def setFacility(facility):
"""Sets the facility to connect to. If an unknown facility is provided,
Expand All @@ -191,6 +197,7 @@ def setHosts(hosts):
hosts = [hosts]
logger.debug("setting new server hosts to: %s" % hosts)
Cuebot.Hosts = hosts
Cuebot.resetChannel()

@staticmethod
def setTimeout(timeout):
Expand All @@ -199,7 +206,7 @@ def setTimeout(timeout):
@type timeout: int
"""
logger.debug("setting new server timeout to: %d" % timeout)
Cuebot.Timeout = timeout
Cuebot.Timeout = timeout

@classmethod
def getProto(cls, name):
Expand Down

0 comments on commit cef1484

Please sign in to comment.