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

rm-hull / metoffice-uk-weather-overlays
9%

Build:
DEFAULT BRANCH: main
Repo Added 15 Sep 2025 08:10PM UTC
Token 488ZNwbCawojAXdcADBLVmw7qJwL0tjNA regen
Build 112 Last
Files 13
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH main
branch: main
CHANGE BRANCH
x
Reset
Sync Branches
  • main
  • chore/docker-image-build
  • chore/go-routine
  • chore/update-deps
  • chore/update-readme
  • dependabot/github_actions/actions/cache-5
  • dependabot/github_actions/actions/checkout-6
  • dependabot/github_actions/actions/upload-artifact-5
  • dependabot/github_actions/actions/upload-artifact-6
  • dependabot/github_actions/golangci/golangci-lint-action-9
  • dependabot/github_actions/mikepenz/action-junit-report-6
  • dependabot/go_modules/github.com/Depado/ginprom-1.8.2
  • dependabot/go_modules/github.com/rm-hull/godx-0.0.10
  • dependabot/go_modules/github.com/rm-hull/godx-0.0.2
  • dependabot/go_modules/github.com/rm-hull/godx-0.0.3
  • dependabot/go_modules/github.com/rm-hull/godx-0.0.4
  • dependabot/go_modules/github.com/rm-hull/godx-0.0.5
  • dependabot/go_modules/github.com/rm-hull/godx-0.0.6
  • dependabot/go_modules/github.com/rm-hull/godx-0.0.7
  • dependabot/go_modules/github.com/rm-hull/godx-0.0.8
  • dependabot/go_modules/github.com/rm-hull/godx-0.0.9
  • dependabot/go_modules/github.com/spf13/cobra-1.10.2
  • dependabot/go_modules/github.com/tavsec/gin-healthcheck-1.7.11
  • dependabot/go_modules/github.com/tavsec/gin-healthcheck-1.7.12
  • dependabot/go_modules/golang.org/x/image-0.32.0
  • dependabot/go_modules/golang.org/x/image-0.33.0
  • dependabot/go_modules/golang.org/x/image-0.34.0
  • doc/update-readme
  • feat/cobra-cmd
  • feat/cron-schedule
  • feat/dataSpec-1.1.0
  • feat/debug-info
  • feat/download-cmd
  • feat/log-resp-info
  • feat/prometheus
  • feat/scheduler
  • feat/simultaneous-fetch-pools
  • feat/temporary-redirects
  • fix/dpt-style
  • test/datahub

23 Dec 2025 08:52PM UTC coverage: 9.252% (-0.7%) from 10.0%
20471331165

push

github

web-flow
feat: add background cron job for data downloads (#42)

* feat: add background cron job for data downloads

Automate weather data retrieval by integrating a background cron job
within the API server. This ensures that the local data cache is
periodically updated without manual intervention.

To support this, the downloader logic has been refactored from the `cmd`
package into the `internal` package to allow shared access between the
CLI download command and the background task. Additionally, the API
server now validates required environment variables on startup and
propagates errors back to the root command.

*   Added `github.com/robfig/cron/v3` dependency.
*   Moved `Processor` and image pipeline logic to
`internal/downloader.go`.
*   Implemented `StartCron` in `internal/cron.go` with a pre-defined
    schedule.
*   Updated `ApiServer` to initialize the cron scheduler before starting
    the HTTP listener.

```mermaid
sequenceDiagram
    participant CLI as Main / CLI
    participant API as ApiServer
    participant Cron as Cron Scheduler
    participant DL as Downloader

    CLI->>API: ApiServer(root, port, debug)
    API->>API: Validate Environment Variables
    API->>Cron: StartCron(root, apiKey, orderId)
    activate Cron
    Cron-->>API: Return Cron Instance
    deactivate Cron
    API->>API: Start Gin Server (HTTP)

    Note over Cron: At 04:30, 05:30, 06:30
    Cron->>DL: NewDownloader(...)
    Cron->>DL: StartWorkers()
    Cron->>DL: DispatchJobs()
    Cron->>DL: Wait()
    DL-->>Cron: Log Results/Errors
```

* Update internal/cron.go

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

---------

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

0 of 202 new or added lines in 5 files covered. (0.0%)

1 existing line in 1 file now uncovered.

47 of 508 relevant lines covered (9.25%)

0.1 hits per line

Relevant lines Covered
Build:
Build:
508 RELEVANT LINES 47 COVERED LINES
0.1 HITS PER LINE
Source Files on main
  • Tree
  • List 13
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
20471331165 main feat: add background cron job for data downloads (#42) * feat: add background cron job for data downloads Automate weather data retrieval by integrating a background cron job within the API server. This ensures that the local data cache is perio... push 23 Dec 2025 08:52PM UTC web-flow github
9.25
20470650577 main chore: remove explicit CGO_ENABLED from Dockerfile Remove the `CGO_ENABLED=1` environment variable to use the default Go build behavior. This simplifies the build configuration and reduces unnecessary dependencies on host C libraries. push 23 Dec 2025 08:17PM UTC rm-hull github
10.0
20260223731 main Bump actions/upload-artifact from 5 to 6 (#40) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/... push 16 Dec 2025 07:39AM UTC web-flow github
10.0
20260221390 main Bump github.com/rm-hull/godx from 0.0.9 to 0.0.10 (#41) Bumps [github.com/rm-hull/godx](https://github.com/rm-hull/godx) from 0.0.9 to 0.0.10. - [Release notes](https://github.com/rm-hull/godx/releases) - [Commits](https://github.com/rm-hull/godx... push 16 Dec 2025 07:39AM UTC web-flow github
10.0
20182325735 main Bump actions/cache from 4 to 5 (#38) Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commit... push 12 Dec 2025 11:04PM UTC web-flow github
10.0
20182323903 main Bump github.com/rm-hull/godx from 0.0.8 to 0.0.9 (#39) Bumps [github.com/rm-hull/godx](https://github.com/rm-hull/godx) from 0.0.8 to 0.0.9. - [Release notes](https://github.com/rm-hull/godx/releases) - [Commits](https://github.com/rm-hull/godx/c... push 12 Dec 2025 11:04PM UTC web-flow github
10.0
20072991330 main Bump golang.org/x/image from 0.33.0 to 0.34.0 (#37) Bumps [golang.org/x/image](https://github.com/golang/image) from 0.33.0 to 0.34.0. - [Commits](https://github.com/golang/image/compare/v0.33.0...v0.34.0) --- updated-dependencies: - dependency-... push 09 Dec 2025 05:42PM UTC web-flow github
10.0
19938437470 main Bump github.com/spf13/cobra from 1.10.1 to 1.10.2 (#36) Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.10.1 to 1.10.2. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](https://github.com/spf13/cobra/co... push 04 Dec 2025 05:45PM UTC web-flow github
10.0
19578740857 main Bump github.com/rm-hull/godx from 0.0.7 to 0.0.8 (#35) Bumps [github.com/rm-hull/godx](https://github.com/rm-hull/godx) from 0.0.7 to 0.0.8. - [Release notes](https://github.com/rm-hull/godx/releases) - [Commits](https://github.com/rm-hull/godx/c... push 21 Nov 2025 05:41PM UTC web-flow github
10.0
19545825604 main Bump actions/checkout from 5 to 6 (#33) Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGEL... push 20 Nov 2025 05:35PM UTC web-flow github
10.0
See All Builds (112)

Badge your Repo: metoffice-uk-weather-overlays

We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.

Could not find badge in README.

Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

Refresh
  • Settings
  • Repo on GitHub
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

© 2025 Coveralls, Inc