TromsFylkestrafikk / ragnarok

Harvest public transport data for statistics usage
0 stars 0 forks source link

Re-scan state on chunks #58

Closed tfk-kaare closed 7 months ago

tfk-kaare commented 7 months ago

Problem / motivation

Chunks now have several fields with values causing them to be 'locked' or un-editable. But unforseen cases happen where we have in-valid state:

Suggested resolution

Add a scheduled runner that scans chunks and fixes the following:

  1. If member of a batch, assert the batch is running. Remove batch connection if batch is finished/failed.
  2. If not member of a batch, look for in_progress states and compare it with the last modified date of the chunk. Also look for the fetch/import size to set the status to 'new' or 'failed'