[Buildbot-devel] Build Only During Certain Times

Andrew Wilkinson andrewjwilkinson at gmail.com
Thu Feb 8 14:46:58 UTC 2007


Hi,

I would like to use a scheduler so that a certain buildbot slave will only
perform builds between 2am and 10pm. I couldn't find anything prebuilt to do
this, so I created the scheduler below.

class TomSchedule(Scheduler):
    def setTimer(self, when):
        now = time.localtime()
        twoam = time.mktime((now[0], now[1], now[2], 2, 0, 0, now[6],
now[7], now[8]))
        tenam = time.mktime((now[0], now[1], now[2], 10, 0, 0, now[6],
now[7], now[8]))
        if not (when >= twoam and when < tenam):
          if when < twoam:
                when = twoam
            else:
                when = twoam + 60*60*24
        Scheduler.setTimer(self, when)

Unfortunately the build slave never seems to build anything, and I can't
find any errors in the buildbot log.

Is there something that can already do this, or have I made a mistake in my
scheduler?

Regards,
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20070208/0c6650df/attachment.html>


More information about the devel mailing list