本文整理汇总了Python中buildbot.status.slave.SlaveStatus.recordConnectTime方法的典型用法代码示例。如果您正苦于以下问题:Python SlaveStatus.recordConnectTime方法的具体用法?Python SlaveStatus.recordConnectTime怎么用?Python SlaveStatus.recordConnectTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类buildbot.status.slave.SlaveStatus
的用法示例。
在下文中一共展示了SlaveStatus.recordConnectTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AbstractBuildSlave
# 需要导入模块: from buildbot.status.slave import SlaveStatus [as 别名]
# 或者: from buildbot.status.slave.SlaveStatus import recordConnectTime [as 别名]
#.........这里部分代码省略.........
self.botmaster = botmaster
self.updateLocks()
self.startMissingTimer()
def stopMissingTimer(self):
if self.missing_timer:
self.missing_timer.cancel()
self.missing_timer = None
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 doKeepalive(self):
self.keepalive_timer = reactor.callLater(self.keepalive_interval,
self.doKeepalive)
if not self.slave:
return
d = self.slave.callRemote("print", "Received keepalive from master")
d.addErrback(log.msg, "Keepalive failed for '%s'" % (self.slavename, ))
def stopKeepaliveTimer(self):
if self.keepalive_timer:
self.keepalive_timer.cancel()
def startKeepaliveTimer(self):
assert self.keepalive_interval
log.msg("Starting buildslave keepalive timer for '%s'" % \
(self.slavename, ))
self.doKeepalive()
def recordConnectTime(self):
if self.slave_status:
self.slave_status.recordConnectTime()
def isConnected(self):
return self.slave
def _missing_timer_fired(self):
self.missing_timer = None
# notify people, but only if we're still in the config
if not self.parent:
return
buildmaster = self.botmaster.master
status = buildmaster.getStatus()
text = "The Buildbot working for '%s'\n" % status.getTitle()
text += ("has noticed that the buildslave named %s went away\n" %
self.slavename)
text += "\n"
text += ("It last disconnected at %s (buildmaster-local time)\n" %
time.ctime(time.time() - self.missing_timeout)) # approx
text += "\n"
text += "The admin on record (as reported by BUILDSLAVE:info/admin)\n"
text += "was '%s'.\n" % self.slave_status.getAdmin()
text += "\n"
text += "Sincerely,\n"
text += " The Buildbot\n"
text += " %s\n" % status.getTitleURL()
subject = "Buildbot: buildslave %s was lost" % self.slavename
return self._mail_missing_message(subject, text)
def updateSlave(self):