Significantly improve the speed of the version upgrader

This knocked about 10 seconds from my boot time. Huzzah :D
This commit is contained in:
Jaime van Kessel 2024-07-03 17:27:27 +02:00
parent 48c3ec77dc
commit 4fb9042dbf
No known key found for this signature in database
GPG key ID: C85F7A3AF1BAA7C4
4 changed files with 2 additions and 29 deletions

View file

@ -152,9 +152,3 @@ class VersionUpgrade22to24(VersionUpgrade):
config.write(output)
return [filename], [output.getvalue()]
def getCfgVersion(self, serialised: str) -> int:
parser = configparser.ConfigParser(interpolation = None)
parser.read_string(serialised)
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
setting_version = int(parser.get("metadata", "setting_version", fallback = "0"))
return format_version * 1000000 + setting_version