Skip to content

Commit

Permalink
Add missing handler
Browse files Browse the repository at this point in the history
  • Loading branch information
timgates42 committed Mar 24, 2020
1 parent 019c6d9 commit d710521
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/meticulous/_addrepo.py
Expand Up @@ -32,6 +32,7 @@ def addrepo_handlers():
return {
"repository_load": repository_load,
"repository_checkout": repository_checkout,
"repository_summary": repository_summary,
}


Expand Down
2 changes: 1 addition & 1 deletion app/meticulous/_multiworker.py
Expand Up @@ -20,7 +20,7 @@ def update_workload(workload):
result = list(workload)
load_count = count_names(workload, {"repository_load"})
active_count = len(get_json_value("repository_map", {}))
for _ in range(3 - active_count - load_count):
for _ in range(2 - active_count - load_count):
result.append({"interactive": True, "name": "repository_load", "priority": 40})
if count_names(workload, {"wait_threadpool"}) < 1:
result.append({"interactive": True, "name": "wait_threadpool", "priority": 999})
Expand Down
2 changes: 1 addition & 1 deletion app/meticulous/_multiworker_test.py
Expand Up @@ -19,7 +19,7 @@ def test_empty_load(get_mock):
result = update_workload(initial)
# Verify
check = [1 for elem in result if elem["name"] == "repository_load"]
assert len(check) == 3 # noqa=S101 # nosec
assert len(check) == 2 # noqa=S101 # nosec


@mock.patch("meticulous._multiworker.get_json_value")
Expand Down
6 changes: 3 additions & 3 deletions app/meticulous/_process.py
Expand Up @@ -274,7 +274,7 @@ def task_collect_nonwords(obj, eng): # pylint: disable=unused-argument
key = "repository_map"
repository_list = get_json_value(key, {})
count = len(repository_list)
if count != 1:
if count < 1:
print(f"Unexpected number of repostories - {count}")
return
reponame = next(iter(repository_list.keys()))
Expand All @@ -287,7 +287,7 @@ def task_submit(obj, eng): # pylint: disable=unused-argument
"""
repository_saves = get_json_value("repository_saves", {})
count = len(repository_saves)
if count != 1:
if count < 1:
print(f"Unexpected number of repostories - {count}")
return
reponame, reposave = next(iter(repository_saves.items()))
Expand All @@ -301,7 +301,7 @@ def task_cleanup(obj, eng): # pylint: disable=unused-argument
key = "repository_map"
repository_map = get_json_value(key, {})
count = len(repository_map)
if count != 1:
if count < 1:
print(f"Unexpected number of repostories - {count}")
return
reponame, reposave = next(iter(repository_map.items()))
Expand Down

0 comments on commit d710521

Please sign in to comment.