[Buildbot-commits] buildbot/buildbot buildslave.py,1.4,1.5

Brian Warner warner at users.sourceforge.net
Sun Aug 12 22:22:43 UTC 2007


Update of /cvsroot/buildbot/buildbot/buildbot
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6009/buildbot

Modified Files:
	buildslave.py 
Log Message:
[project @ BuildSlave: keep track of lastMessageReceived for each slave]

Original author: warner at lothar.com
Date: 2007-08-12 22:15:19+00:00

Index: buildslave.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/buildslave.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- buildslave.py	7 Aug 2007 23:41:05 -0000	1.4
+++ buildslave.py	12 Aug 2007 22:22:41 -0000	1.5
@@ -1,4 +1,5 @@
 
+import time
 from twisted.python import log
 from twisted.internet import defer, reactor
 
@@ -34,6 +35,7 @@
         self.slave_commands = None
         self.slavebuilders = []
         self.max_builds = max_builds
+        self.lastMessageReceived = 0
 
     def update(self, new):
         """
@@ -138,6 +140,7 @@
             self.slave_commands = state.get("slave_commands")
             self.slave = bot
             log.msg("bot attached")
+            self.messageReceivedFromSlave()
             return self.updateSlave()
         d.addCallback(_accept_slave)
 
@@ -146,6 +149,10 @@
         d.addCallback(lambda res: self)
         return d
 
+    def messageReceivedFromSlave(self):
+        now = time.time()
+        self.lastMessageReceived = now
+
     def detached(self, mind):
         self.slave = None
         self.slave_status.setConnected(False)





More information about the Commits mailing list