Skip to content

Commit bc86b9d

Browse files
committed
fix not-awaited future in do_register_gcroot_if
1 parent 440c799 commit bc86b9d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

buildbot_nix/buildbot_nix/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from buildbot.schedulers.triggerable import Triggerable
3030
from buildbot.secrets.providers.file import SecretInAFile
3131
from buildbot.steps.trigger import Trigger
32+
from buildbot.util.twisted import async_to_deferred
3233
from buildbot.www.authz import Authz
3334
from buildbot.www.authz.endpointmatchers import EndpointMatcherBase, Match
3435

@@ -1145,6 +1146,7 @@ def nix_eval_config(
11451146
)
11461147

11471148

1149+
@async_to_deferred
11481150
async def do_register_gcroot_if(
11491151
s: steps.BuildStep | Build, branch_config: models.BranchConfigDict
11501152
) -> bool:
@@ -1154,10 +1156,10 @@ async def do_register_gcroot_if(
11541156
out_path = s.getProperty("out_path")
11551157

11561158
return (
1157-
branch_config.do_register_gcroot(
1159+
s.getProperty("event") == "push"
1160+
and branch_config.do_register_gcroot(
11581161
s.getProperty("default_branch"), s.getProperty("branch")
11591162
)
1160-
and s.getProperty("event") == "push"
11611163
and not (
11621164
Path(str(gc_root)).exists()
11631165
and Path(str(gc_root)).readlink() == Path(out_path)

0 commit comments

Comments
 (0)