Skip to content

Commit

Permalink
Fixes for diegorusso-aarch64-bigmem (#553)
Browse files Browse the repository at this point in the history
* no_builds_between: Return a Deferred
* no_builds_between: Get the current date inside the nextBuild function
  • Loading branch information
encukou authored Nov 6, 2024
1 parent 023d9c2 commit 2000750
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions master/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ from functools import partial
from buildbot.plugins import reporters, schedulers, util
from buildbot import locks
from twisted.python import log
from twisted.internet import defer

import sentry_sdk
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
Expand Down Expand Up @@ -204,19 +205,20 @@ def get_delay(now, end):
# Avoid a build to be started between start and end time and delay such build
# at end time
def no_builds_between(start, end):
now = datetime.now().time()
start = datetime.strptime(start, "%H:%M").time()
end = datetime.strptime(end, "%H:%M").time()
def f(builder, requests):
now = datetime.now().time()
if is_within_time_range(now, start, end):
delay = get_delay(now, end)
# Schedule the build later
deferred = defer.Deferred()
builder.master.reactor.callLater(
int(delay),
builder.buildset_manager.submitBuildSet,
deferred.callback,
requests[0],
)
return None
return deferred
# Schedule the build now
return requests[0]
return f
Expand Down

0 comments on commit 2000750

Please sign in to comment.