-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Conversation
@@ -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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
tools/donate-cpu-server.py
Outdated
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
No description provided.