refs #14665 - donate-cpu-server.py: improved handling of corrupt package-index.txt#8442
refs #14665 - donate-cpu-server.py: improved handling of corrupt package-index.txt#8442firewave wants to merge 1 commit intocppcheck-opensource:mainfrom
package-index.txt#8442Conversation
|
package-index.txtpackage-index.txt
|
This will only help with the server staying up but since we hit this issue a lot recently (it is down again) we will never be able to analyze all the packages if it keeps resetting the index. We really need to determine what is causing this or use a safer save method (locking? save in intervals?). |
Yes that is true. if this happened once in a year it would be fine to just reset. |
| try: | ||
| packageIndex = int(f.read()) | ||
| except ValueError as e: | ||
| logging.error("failed to convert package index to int", exc_info=sys.exc_info()) |
There was a problem hiding this comment.
If reading the file fails I would suggest that we set the default value packageIndex = int(time.time()) % len(packages)
that way if the file gets corrupt frequently we will still analyze files here and there and don't always start from 0. It's not perfect but better imho.



No description provided.