Fix bookability column timestamps showing stale 'last changed' dates
Switch date_last_updated from valid_from (rate change time) to last_verified_at (last check time). All dates verified in the same daily run now show a consistent timestamp rather than varying by when rates last changed. Also commit per-date instead of batching 10 days — prevents a single API error from rolling back up to 9 preceding committed dates. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
218589afbe
commit
d72f14ae49
3 changed files with 22 additions and 4 deletions
|
|
@ -26,7 +26,7 @@ from database import SyncSessionLocal
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
COMMIT_BATCH_SIZE = 10 # Commit to DB every N days
|
||||
COMMIT_BATCH_SIZE = 1 # Commit after every date — prevents rollback from wiping sibling days on API error
|
||||
|
||||
|
||||
def rates_changed(old_rate: Optional[Dict], new_rate: Dict) -> bool:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue