refactor(plugin): rename detection_interval_seconds → detection_interval_minutes (#9366)

Minutes is the natural granularity for detection cadence — every
production handler already set the seconds field to a 60-multiple
(17*60, 30*60, 3600, 24*60*60). Switching to minutes drops the *60
arithmetic and matches the unit conventions used elsewhere in the
plugin worker forms.

- Proto: AdminRuntimeDefaults + AdminRuntimeConfig.detection_interval_*
  field renamed.
- Helpers: durationFromMinutes / minutesFromDuration alongside the
  existing seconds variants in plugin_scheduler.go.
- Handlers: vacuum, ec_balance, balance, erasure_coding, iceberg,
  admin_script, s3_lifecycle now declare DetectionIntervalMinutes.
- Admin: scheduler_status + types + UI templ + plugin_api.go pass
  through the new field; UI label and table cells switch to "min".
This commit is contained in:
Chris Lu authored and GitHub committed 2026-05-08 10:33:02 -07:00
1 parent 7f254e158e
commit 5d43f84df7
23 files changed
+64 -50

No files matched your search

+2 -2
View File
@@ -936,8 +936,8 @@ func applyDescriptorDefaultsToPersistedConfig(
if descriptor.AdminRuntimeDefaults != nil {
runtime := config.AdminRuntime
defaults := descriptor.AdminRuntimeDefaults
if runtime.DetectionIntervalSeconds <= 0 {
runtime.DetectionIntervalSeconds = defaults.DetectionIntervalSeconds
if runtime.DetectionIntervalMinutes <= 0 {
runtime.DetectionIntervalMinutes = defaults.DetectionIntervalMinutes
}
if runtime.DetectionTimeoutSeconds <= 0 {
runtime.DetectionTimeoutSeconds = defaults.DetectionTimeoutSeconds
+2 -2
View File
@@ -137,7 +137,7 @@ func TestApplyDescriptorDefaultsToPersistedConfigBackfillsAdminDefaults(t *testi
},
},
AdminRuntimeDefaults: &plugin_pb.AdminRuntimeDefaults{
DetectionIntervalSeconds: 60,
DetectionIntervalMinutes: 60,
DetectionTimeoutSeconds: 300,
},
}
@@ -152,7 +152,7 @@ func TestApplyDescriptorDefaultsToPersistedConfigBackfillsAdminDefaults(t *testi
if !ok || scriptKind.StringValue == "" {
t.Fatalf("expected non-empty script default, got=%+v", script)
}
if config.AdminRuntime.DetectionIntervalSeconds != 60 {
if config.AdminRuntime.DetectionIntervalMinutes != 60 {
t.Fatalf("expected runtime detection interval default to be backfilled")
}
}