fix: properly debounce Drive API metadata checks in cache
Remove the file mtime check from the API debounce tier in get_sheet_modified_time(). Previously, the debounce was defeated when CACHE_TTL_SECONDS differed from CACHE_API_CHECK_TTL_SECONDS because the file age check would fail even though the API was checked recently. Also fix cache key mappings (attendance_juniors sheet ID, payments_transactions rename) and add tmp/ to .gitignore. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2
app.py
2
app.py
@@ -19,7 +19,7 @@ sys.path.append(str(scripts_dir))
|
||||
|
||||
from attendance import get_members_with_fees, get_junior_members_with_fees, SHEET_ID as ATTENDANCE_SHEET_ID, JUNIOR_SHEET_GID, ADULT_MERGED_MONTHS, JUNIOR_MERGED_MONTHS
|
||||
from match_payments import reconcile, fetch_sheet_data, fetch_exceptions, normalize, DEFAULT_SPREADSHEET_ID as PAYMENTS_SHEET_ID
|
||||
from cache_utils import get_sheet_modified_time, read_cache, write_cache
|
||||
from cache_utils import get_sheet_modified_time, read_cache, write_cache, _LAST_CHECKED
|
||||
|
||||
def get_cached_data(cache_key, sheet_id, fetch_func, *args, **kwargs):
|
||||
mod_time = get_sheet_modified_time(cache_key)
|
||||
|
||||
Reference in New Issue
Block a user