1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-04 16:30:12 +02:00

update: write out cache as soon as possible

When working or testing with large APK collections, oftentimes it can take
hours to scan all the APKs.  If there is a failure before the apkcache is
written out, then all that work is lost since no cache is written out. This
moves the final cache writing before writing the index and knownapks to
make it more likely that the apkcache is successfully written.
This commit is contained in:
Hans-Christoph Steiner 2021-01-13 09:08:22 +01:00
parent b5c8ecd3da
commit 0a1793ab7f

View File

@ -2310,6 +2310,10 @@ def main():
# This will be done again (as part of apply_info_from_latest_apk) for repo and archive
# separately later on, but it's fairly cheap anyway.
read_names_from_apks(apps, apks + archapks)
if cachechanged:
write_cache(apkcache)
# The added date currently comes from the oldest apk which might be in the archive.
# So we need this populated at app level before continuing with only processing /repo
# or /archive
@ -2349,9 +2353,6 @@ def main():
# Update known apks info...
knownapks.writeifchanged()
if cachechanged:
write_cache(apkcache)
# Update the wiki...
if options.wiki:
logging.warning(_('wiki support is deprecated and will be removed in the next release!'))