use scandir instead of listdir
This commit is contained in:
12
master.py
12
master.py
@@ -204,10 +204,14 @@ def parse_repo(name, repo):
|
|||||||
|
|
||||||
|
|
||||||
def sync_marchs_with_config():
|
def sync_marchs_with_config():
|
||||||
repos = [dI for dI in os.listdir(config["basedir"]["repo"]) if
|
repos = []
|
||||||
os.path.isdir(os.path.join(config["basedir"]["repo"], dI))]
|
with os.scandir(config["basedir"]["repo"]) as it:
|
||||||
|
entry: os.DirEntry
|
||||||
|
for entry in it:
|
||||||
|
if not entry.name.startswith('logs') and entry.is_dir():
|
||||||
|
repos.append(entry.name)
|
||||||
|
|
||||||
repo_quota = ["logs"]
|
repo_quota = []
|
||||||
|
|
||||||
for r, a in ((x, y) for x in config["repos"] for y in config["march"]):
|
for r, a in ((x, y) for x in config["repos"] for y in config["march"]):
|
||||||
repo_quota.append("{}-{}".format(r, a))
|
repo_quota.append("{}-{}".format(r, a))
|
||||||
@@ -261,7 +265,7 @@ def fill_queue():
|
|||||||
logging.debug("[%s/%s] Build queued (new version available %s < %s)", repo, name,
|
logging.debug("[%s/%s] Build queued (new version available %s < %s)", repo, name,
|
||||||
parse_repo(name, repo), parse_pkgbuild(pkgb))
|
parse_repo(name, repo), parse_pkgbuild(pkgb))
|
||||||
|
|
||||||
logging.info("Queue size after fill: %s", q.qsize())
|
logging.info("Build queue size: %s", q.qsize())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Reference in New Issue
Block a user