2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-13 22:17:07 +00:00

clear cache on parsing & 2.2.19 notes

This commit is contained in:
Philip Sargent
2021-04-10 02:12:13 +01:00
parent 876868506f
commit a7e59b2bb0
3 changed files with 30 additions and 25 deletions

View File

@@ -10,7 +10,7 @@ from django.conf import settings
from django.template.defaultfilters import slugify
from django.utils.timezone import get_current_timezone, make_aware
from troggle.core.models import DataIssue, Expedition
from troggle.core.models import DataIssue, Expedition, TROG
from troggle.core.models_caves import Cave, LogbookEntry, PersonTrip, GetCaveLookup
from parsers.people import GetPersonExpeditionNameLookup
from utils import save_carefully
@@ -86,7 +86,6 @@ def EnterLogIntoDbase(date, place, title, text, trippeople, expedition, logtime_
""" saves a logbook entry and related persontrips
Does NOT save the expeditionday_id - all NULLs. why?
"""
trippersons, author = GetTripPersons(trippeople, expedition, logtime_underground)
if not author:
print(" ! - Skipping logentry: " + title + " - no author for entry")
@@ -417,7 +416,7 @@ def SetDatesFromLogbookEntries(expedition):
persontrip.save() # also saved in EnterLogIntoDbase. MERGE these to speed up import.
def LoadLogbookForExpedition(expedition,expect):
def LoadLogbookForExpedition(expedition, expect):
""" Parses all logbook entries for one expedition
If a cache is found it uses it. If not found, or fails sanity checks, parses source file.
"""
@@ -544,6 +543,7 @@ def LoadLogbooks():
expd ={}
with open("loadlogbk.log", "a") as log:
for expo in expos:
TROG['pagecache']['expedition'][expo.year] = None # clear cache
if expo.year not in nologbook:
print((" - Logbook for: " + expo.year))
numentries = LoadLogbookForExpedition(expo, entries[expo.year])