Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed #12664 - donate-cpu-server.py: omit outdated results from diff reports #6349

Merged
merged 1 commit into from
Apr 27, 2024

Conversation

firewave
Copy link
Collaborator

No description provided.

@@ -422,7 +422,7 @@ def diffReport(resultsPath: str) -> str:
for messageId in data['sums']:
sums = data['sums'][messageId]
if OLD_VERSION not in sums:
continue
break
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just bail out on the first occurrence of an old version because if one entry is outdated all of them are.

@@ -490,9 +490,12 @@ def diffMessageIdReport(resultPath: str, messageId: str) -> str:
if not os.path.isfile(filename):
continue
with open(filename, 'rt') as f:
diff_stats = f.read()
if messageId not in diff_stats:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This always checked the whole string for the occurrence. This might speed up things a bit if there was a lot of findings - unless it is offset by the added JSON loading.

@firewave firewave marked this pull request as draft April 26, 2024 21:12
diff_stats = json.loads(f.read())
if messageId not in diff_stats['sums']:
continue
if OLD_VERSION not in diff_stats['sums'][messageId]:
continue
if today not in diff_stats:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the report and it is no longer a string but an object. Will fix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have fixed this but cannot test it right now because because requests to daca somehow do not work right now (I have no idea why - restarting it didn't help) and I cannot find a message ID to test it with.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@firewave firewave marked this pull request as ready for review April 26, 2024 23:31
@chrchr-github chrchr-github merged commit 55554ca into danmar:main Apr 27, 2024
64 checks passed
@firewave firewave deleted the donate-diff branch April 27, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants