Skip to content

Commit 6bdbbc0

Browse files
committed
fix NameError
1 parent 4541667 commit 6bdbbc0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lilac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def try_pick_some(
310310
return []
311311

312312
rusages = db.get_pkgs_last_rusage(ready_to_build)
313-
ready_to_build.sort(key=lambda pkg: rusages.get(pkg) and r.cputime or 3600) # type: ignore
313+
ready_to_build.sort(key=lambda pkg: (r := rusages.get(pkg)) and r.cputime or 3600)
314314
if cpu_ratio < 1.0:
315315
# low cpu usage, build a big package
316316
ready_to_build.insert(0, ready_to_build.pop())
@@ -339,7 +339,7 @@ def try_pick_some(
339339
if not ret:
340340
if starving:
341341
ready_to_build.sort(
342-
key=lambda pkg: rusages.get(pkg) and r.memory or 10 * 1024**3, # type: ignore
342+
key=lambda pkg: (r := rusages.get(pkg)) and r.memory or 10 * 1024**3,
343343
)
344344
logger.info('insufficient memory, starting only one build')
345345
for pkg in ready_to_build:

0 commit comments

Comments
 (0)