Test 10-min cache (should skip calendar calls)

This commit is contained in:
Otto 2026-03-07 16:35:23 +01:00
parent f4eb0ad678
commit 4bf5ab2176
7 changed files with 32 additions and 2 deletions

View file

@ -108,7 +108,18 @@ for COMMIT in $COMMITS; do
# Cache as pending
cache_status "$COMMIT" "pending"
# Try to upgrade existing proof (only contacts calendars if pending)
# Skip upgrade if cache is fresh (< 10 min old)
CACHE_LINE=$(grep "^$COMMIT:" "$STATUS_CACHE" | tail -1)
CACHE_TIME=$(echo "$CACHE_LINE" | cut -d: -f3)
NOW=$(date +%s)
CACHE_AGE=$((NOW - CACHE_TIME))
if [ "$CACHE_AGE" -lt 600 ]; then
echo " - Pending (cached <10min, skipping calendar call)"
continue
fi
# Try to upgrade existing proof (contacts calendars)
echo " Upgrading pending proof..."
if ots upgrade "$PROOF_FILE" 2>/dev/null; then
echo " ✓ Upgraded to attested"
@ -116,6 +127,8 @@ for COMMIT in $COMMITS; do
UPDATED=$((UPDATED + 1))
else
echo " - Still pending (no upgrade available yet)"
# Update cache timestamp
cache_status "$COMMIT" "pending"
fi
else
# Generate new proof for this commit