Skip to content

data-usage: background job skeleton and setting to enable / disable

Administrator requested to merge usage-data/background-job into main

Created by: coury-clark

Part of RFC 719 Closes #39086

Implements a skeleton worker job that runs every minute and can be toggled on / off from a setting.

If you're confused by the commit history, for some reason the db initialization was failing in CI (but not locally). Since it's not necessary right now I've simply removed it for this PR to pass.

Test plan

After enabling:

[         worker] INFO worker.export-usage-telemetry telemetry/telemetry_job.go:75 telemetryHandler executed

After disabling (once initialized)

[         worker] ERROR goroutine/periodic.go:153 operation.error {"count": 1, "elapsed": 0.000017139, "error": "Usage telemetry export is disabled, but the background job is attempting to execute. This means the configuration was disabled without restarting the worker service. This job is aborting, and no telemetry will be exported."}

Merge request reports

Loading