本文整理汇总了Python中buildbot.status.slave.SlaveStatus.removeInfoWatcher方法的典型用法代码示例。如果您正苦于以下问题:Python SlaveStatus.removeInfoWatcher方法的具体用法?Python SlaveStatus.removeInfoWatcher怎么用?Python SlaveStatus.removeInfoWatcher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类buildbot.status.slave.SlaveStatus
的用法示例。
在下文中一共展示了SlaveStatus.removeInfoWatcher方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AbstractBuildSlave
# 需要导入模块: from buildbot.status.slave import SlaveStatus [as 别名]
# 或者: from buildbot.status.slave.SlaveStatus import removeInfoWatcher [as 别名]
#.........这里部分代码省略.........
self.password = new.password
self.registered_port = new_config.protocols["pb"]["port"]
self.registration = self.master.pbmanager.register(
self.registered_port, self.slavename, self.password, self.getPerspective
)
# adopt new instance's configuration parameters
self.max_builds = new.max_builds
self.access = new.access
self.notify_on_missing = new.notify_on_missing
self.keepalive_interval = new.keepalive_interval
if self.missing_timeout != new.missing_timeout:
running_missing_timer = self.missing_timer
self.stopMissingTimer()
self.missing_timeout = new.missing_timeout
if running_missing_timer:
self.startMissingTimer()
properties = Properties()
properties.updateFromProperties(new.properties)
self.properties = properties
self.updateLocks()
# update the attached slave's notion of which builders are attached.
# This assumes that the relevant builders have already been configured,
# which is why the reconfig_priority is set low in this class.
yield self.updateSlave()
yield config.ReconfigurableServiceMixin.reconfigService(self, new_config)
def stopService(self):
self.slave_status.removeInfoWatcher(self._saveSlaveInfoDict)
if self.registration:
self.registration.unregister()
self.registration = None
self.stopMissingTimer()
return service.MultiService.stopService(self)
def findNewSlaveInstance(self, new_config):
# TODO: called multiple times per reconfig; use 1-element cache?
for sl in new_config.slaves:
if sl.slavename == self.slavename:
return sl
assert 0, "no new slave named '%s'" % self.slavename
def startMissingTimer(self):
if self.notify_on_missing and self.missing_timeout and self.parent:
self.stopMissingTimer() # in case it's already running
self.missing_timer = reactor.callLater(self.missing_timeout, self._missing_timer_fired)
def stopMissingTimer(self):
if self.missing_timer:
self.missing_timer.cancel()
self.missing_timer = None
def getPerspective(self, mind, slavename):
assert slavename == self.slavename
metrics.MetricCountEvent.log("attached_slaves", 1)
# record when this connection attempt occurred
if self.slave_status:
self.slave_status.recordConnectTime()
# try to use TCP keepalives