feat(CUB-39): Create background job for filament usage sync #16

Merged
overseer merged 3 commits from agent/dex/CUB-39-filament-usage-sync into dev 2026-04-27 17:34:00 -04:00
Owner

Summary

Implements a background job that periodically polls Moonraker printers for filament usage data and persists updates to the Extrudex database.

Changes

  • IMoonrakerClient (Domain interface): HTTP client interface for Moonraker REST API communication
  • MoonrakerClient (Infrastructure service): Typed HTTP client for querying Moonraker endpoints (filament usage, server info)
  • IFilamentUsageSyncService (Domain interface): Sync orchestration interface
  • FilamentUsageSyncService (Infrastructure service): Queries all active Moonraker printers, fetches usage data, updates spool weights and printer status
  • FilamentUsageSyncJob (API background service): BackgroundService that runs on a configurable interval with graceful cancellation
  • FilamentUsageSyncOptions (Infrastructure config): Polling interval, request timeout, and enabled/disabled toggle — bound from appsettings.json
  • Program.cs: Registers IMoonrakerClient via AddHttpClient, IFilamentUsageSyncService, and AddHostedService<FilamentUsageSyncJob>
  • appsettings.json / appsettings.Development.json: Added FilamentUsageSync config section

Configuration

"FilamentUsageSync": {
  "PollingInterval": "00:05:00",
  "RequestTimeout": "00:00:30",
  "Enabled": true
}

Validation

  • dotnet build — PASS (0 errors)

Closes CUB-39

## Summary Implements a background job that periodically polls Moonraker printers for filament usage data and persists updates to the Extrudex database. ### Changes - **IMoonrakerClient** (Domain interface): HTTP client interface for Moonraker REST API communication - **MoonrakerClient** (Infrastructure service): Typed HTTP client for querying Moonraker endpoints (filament usage, server info) - **IFilamentUsageSyncService** (Domain interface): Sync orchestration interface - **FilamentUsageSyncService** (Infrastructure service): Queries all active Moonraker printers, fetches usage data, updates spool weights and printer status - **FilamentUsageSyncJob** (API background service): `BackgroundService` that runs on a configurable interval with graceful cancellation - **FilamentUsageSyncOptions** (Infrastructure config): Polling interval, request timeout, and enabled/disabled toggle — bound from `appsettings.json` - **Program.cs**: Registers `IMoonrakerClient` via `AddHttpClient`, `IFilamentUsageSyncService`, and `AddHostedService<FilamentUsageSyncJob>` - **appsettings.json / appsettings.Development.json**: Added `FilamentUsageSync` config section ### Configuration ```json "FilamentUsageSync": { "PollingInterval": "00:05:00", "RequestTimeout": "00:00:30", "Enabled": true } ``` ### Validation - `dotnet build` — PASS (0 errors) Closes CUB-39
Dex added 1 commit 2026-04-27 13:24:09 -04:00
feat(CUB-39): create background job for filament usage sync
Some checks failed
Dev Build / build-test (pull_request) Failing after 48s
Dev Build / deploy-dev (pull_request) Has been skipped
Dev Build / notify-success (pull_request) Has been skipped
Dev Build / notify-failure (pull_request) Successful in 3s
4ba98966eb
overseer added 1 commit 2026-04-27 14:15:19 -04:00
Merge branch 'dev' into agent/dex/CUB-39-filament-usage-sync
Some checks failed
Dev Build / build-test (pull_request) Failing after 52s
Dev Build / deploy-dev (pull_request) Has been skipped
Dev Build / notify-success (pull_request) Has been skipped
Dev Build / notify-failure (pull_request) Successful in 3s
d43985cad9
overseer scheduled this pull request to auto merge when all checks succeed 2026-04-27 14:15:37 -04:00
overseer added 1 commit 2026-04-27 17:26:00 -04:00
Merge branch 'dev' into agent/dex/CUB-39-filament-usage-sync
Some checks failed
Dev Build / build-test (pull_request) Failing after 1m3s
Dev Build / deploy-dev (pull_request) Has been skipped
Dev Build / notify-success (pull_request) Has been skipped
Dev Build / notify-failure (pull_request) Successful in 4s
73363206ec
overseer scheduled this pull request to auto merge when all checks succeed 2026-04-27 17:33:55 -04:00
overseer merged commit c150f54c64 into dev 2026-04-27 17:34:00 -04:00
overseer deleted branch agent/dex/CUB-39-filament-usage-sync 2026-04-27 17:34:00 -04:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CubeCraft-Creations/Extrudex#16