Various fixes
- Improved pipeline performance - Improver importer progress - Steam API slow down to not get 429-ed (but still allow bursts on smaller steam libraries)
This commit is contained in:
@@ -30,7 +30,7 @@ class Pipeline(GObject.Object):
|
||||
|
||||
@property
|
||||
def is_done(self) -> bool:
|
||||
return len(self.not_done) == 0
|
||||
return len(self.waiting) == 0 and len(self.running) == 0
|
||||
|
||||
@property
|
||||
def blocked(self) -> set[Manager]:
|
||||
@@ -49,6 +49,17 @@ class Pipeline(GObject.Object):
|
||||
"""Get the managers that can be run"""
|
||||
return self.waiting - self.blocked
|
||||
|
||||
@property
|
||||
def progress(self) -> float:
|
||||
"""Get the pipeline progress. Should only be a rough idea."""
|
||||
n_done = len(self.done)
|
||||
n_total = len(self.waiting) + len(self.running) + n_done
|
||||
try:
|
||||
progress = n_done / n_total
|
||||
except ZeroDivisionError:
|
||||
progress = 1
|
||||
return progress
|
||||
|
||||
def advance(self):
|
||||
"""Spawn tasks for managers that are able to run for a game"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user