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

+8 -8
View File
@@ -2485,7 +2485,7 @@ func (x *ValueMap) GetFields() map[string]*ConfigValue {
type AdminRuntimeDefaults struct {
state protoimpl.MessageState `protogen:"open.v1"`
Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
DetectionIntervalSeconds int32 `protobuf:"varint,2,opt,name=detection_interval_seconds,json=detectionIntervalSeconds,proto3" json:"detection_interval_seconds,omitempty"`
DetectionIntervalMinutes int32 `protobuf:"varint,2,opt,name=detection_interval_minutes,json=detectionIntervalMinutes,proto3" json:"detection_interval_minutes,omitempty"`
DetectionTimeoutSeconds int32 `protobuf:"varint,3,opt,name=detection_timeout_seconds,json=detectionTimeoutSeconds,proto3" json:"detection_timeout_seconds,omitempty"`
MaxJobsPerDetection int32 `protobuf:"varint,4,opt,name=max_jobs_per_detection,json=maxJobsPerDetection,proto3" json:"max_jobs_per_detection,omitempty"`
GlobalExecutionConcurrency int32 `protobuf:"varint,5,opt,name=global_execution_concurrency,json=globalExecutionConcurrency,proto3" json:"global_execution_concurrency,omitempty"`
@@ -2538,9 +2538,9 @@ func (x *AdminRuntimeDefaults) GetEnabled() bool {
return false
}
func (x *AdminRuntimeDefaults) GetDetectionIntervalSeconds() int32 {
func (x *AdminRuntimeDefaults) GetDetectionIntervalMinutes() int32 {
if x != nil {
return x.DetectionIntervalSeconds
return x.DetectionIntervalMinutes
}
return 0
}
@@ -2604,7 +2604,7 @@ func (x *AdminRuntimeDefaults) GetExecutionTimeoutSeconds() int32 {
type AdminRuntimeConfig struct {
state protoimpl.MessageState `protogen:"open.v1"`
Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
DetectionIntervalSeconds int32 `protobuf:"varint,2,opt,name=detection_interval_seconds,json=detectionIntervalSeconds,proto3" json:"detection_interval_seconds,omitempty"`
DetectionIntervalMinutes int32 `protobuf:"varint,2,opt,name=detection_interval_minutes,json=detectionIntervalMinutes,proto3" json:"detection_interval_minutes,omitempty"`
DetectionTimeoutSeconds int32 `protobuf:"varint,3,opt,name=detection_timeout_seconds,json=detectionTimeoutSeconds,proto3" json:"detection_timeout_seconds,omitempty"`
MaxJobsPerDetection int32 `protobuf:"varint,4,opt,name=max_jobs_per_detection,json=maxJobsPerDetection,proto3" json:"max_jobs_per_detection,omitempty"`
GlobalExecutionConcurrency int32 `protobuf:"varint,5,opt,name=global_execution_concurrency,json=globalExecutionConcurrency,proto3" json:"global_execution_concurrency,omitempty"`
@@ -2654,9 +2654,9 @@ func (x *AdminRuntimeConfig) GetEnabled() bool {
return false
}
func (x *AdminRuntimeConfig) GetDetectionIntervalSeconds() int32 {
func (x *AdminRuntimeConfig) GetDetectionIntervalMinutes() int32 {
if x != nil {
return x.DetectionIntervalSeconds
return x.DetectionIntervalMinutes
}
return 0
}
@@ -4121,7 +4121,7 @@ const file_plugin_proto_rawDesc = "" +
"\x05value\x18\x02 \x01(\v2\x13.plugin.ConfigValueR\x05value:\x028\x01\"\xbb\x04\n" +
"\x14AdminRuntimeDefaults\x12\x18\n" +
"\aenabled\x18\x01 \x01(\bR\aenabled\x12<\n" +
"\x1adetection_interval_seconds\x18\x02 \x01(\x05R\x18detectionIntervalSeconds\x12:\n" +
"\x1adetection_interval_minutes\x18\x02 \x01(\x05R\x18detectionIntervalMinutes\x12:\n" +
"\x19detection_timeout_seconds\x18\x03 \x01(\x05R\x17detectionTimeoutSeconds\x123\n" +
"\x16max_jobs_per_detection\x18\x04 \x01(\x05R\x13maxJobsPerDetection\x12@\n" +
"\x1cglobal_execution_concurrency\x18\x05 \x01(\x05R\x1aglobalExecutionConcurrency\x12G\n" +
@@ -4134,7 +4134,7 @@ const file_plugin_proto_rawDesc = "" +
" \x01(\x05R\x17executionTimeoutSeconds\"\xb9\x04\n" +
"\x12AdminRuntimeConfig\x12\x18\n" +
"\aenabled\x18\x01 \x01(\bR\aenabled\x12<\n" +
"\x1adetection_interval_seconds\x18\x02 \x01(\x05R\x18detectionIntervalSeconds\x12:\n" +
"\x1adetection_interval_minutes\x18\x02 \x01(\x05R\x18detectionIntervalMinutes\x12:\n" +
"\x19detection_timeout_seconds\x18\x03 \x01(\x05R\x17detectionTimeoutSeconds\x123\n" +
"\x16max_jobs_per_detection\x18\x04 \x01(\x05R\x13maxJobsPerDetection\x12@\n" +
"\x1cglobal_execution_concurrency\x18\x05 \x01(\x05R\x1aglobalExecutionConcurrency\x12G\n" +