chore: log more commits length
All checks were successful
build / trigger-build-image (push) Successful in 16s
All checks were successful
build / trigger-build-image (push) Successful in 16s
This commit is contained in:
parent
99d889ee12
commit
e160023cbf
|
@ -386,11 +386,13 @@ class Teapot:
|
||||||
time_windows.append(since)
|
time_windows.append(since)
|
||||||
valid_items.append((name, max_count, time_period, since))
|
valid_items.append((name, max_count, time_period, since))
|
||||||
logger.info(f"valid items: {valid_items}, time windows: {time_windows}")
|
logger.info(f"valid items: {valid_items}, time windows: {time_windows}")
|
||||||
all_commits = []
|
matched_commits = []
|
||||||
|
all_commits_length = 0
|
||||||
if time_windows:
|
if time_windows:
|
||||||
earliest_since = min(time_windows).strftime("%Y-%m-%dT%H:%M:%S")
|
earliest_since = min(time_windows).strftime("%Y-%m-%dT%H:%M:%S")
|
||||||
commits = repo.iter_commits(paths=scoreboard_filename, since=earliest_since)
|
commits = repo.iter_commits(paths=scoreboard_filename, since=earliest_since)
|
||||||
for commit in commits:
|
for commit in commits:
|
||||||
|
all_commits_length += 1
|
||||||
lines = commit.message.strip().splitlines()
|
lines = commit.message.strip().splitlines()
|
||||||
if not lines:
|
if not lines:
|
||||||
continue
|
continue
|
||||||
|
@ -408,17 +410,19 @@ class Teapot:
|
||||||
commit_groups = (
|
commit_groups = (
|
||||||
groups_line[len("groups: ") :].split(",") if groups_line else []
|
groups_line[len("groups: ") :].split(",") if groups_line else []
|
||||||
)
|
)
|
||||||
all_commits.append(
|
matched_commits.append(
|
||||||
{
|
{
|
||||||
"time": commit.committed_datetime,
|
"time": commit.committed_datetime,
|
||||||
"groups": [g.strip() for g in commit_groups],
|
"groups": [g.strip() for g in commit_groups],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
logger.info(f"all commits length: {len(all_commits)}")
|
logger.info(
|
||||||
|
f"matched commits length: {len(matched_commits)}, all commits length: {all_commits_length}"
|
||||||
|
)
|
||||||
for name, max_count, time_period, since in valid_items:
|
for name, max_count, time_period, since in valid_items:
|
||||||
submit_count = 0
|
submit_count = 0
|
||||||
time_limit = now - timedelta(hours=time_period)
|
time_limit = now - timedelta(hours=time_period)
|
||||||
for commit in all_commits:
|
for commit in matched_commits:
|
||||||
if commit["time"] < time_limit:
|
if commit["time"] < time_limit:
|
||||||
continue
|
continue
|
||||||
if name:
|
if name:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user