• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / next-departures-api / 25073731598

28 Apr 2026 07:38PM UTC coverage: 7.488% (-0.2%) from 7.673%
25073731598

push

github

web-flow
feat: add cron job for periodic NaPTAN updates (#3)

Introduces a background worker to automatically refresh the NaPTAN
dataset at regular intervals.

- Added `github.com/robfig/cron/v3` dependency.
- Implemented a cron job that triggers every 19 hours.
- Centralized the NaPTAN dataset URL in `internal/models`.
- Updated `ApiServer` to initialize the scheduler on startup.
- Refined import logging frequency and messaging.

```mermaid
sequenceDiagram
    participant S as API Server
    participant C as Cron Scheduler
    participant E as External NaPTAN API
    participant R as Repository (SQLite)

    S->>C: StartCron(repo)
    loop Every 19 hours
        C->>E: Download CSV
        E-->>C: CSV Stream
        C->>R: ImportCSV()
        Note right of R: Transactional Update
        R-->>C: Done
    end
```

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

0 of 25 new or added lines in 4 files covered. (0.0%)

1 existing line in 1 file now uncovered.

62 of 828 relevant lines covered (7.49%)

0.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/cmd/api_server.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc