mirror of
https://github.com/henrygd/beszel.git
synced 2026-09-30 13:27:46 +02:00
fix(hub): pad short monitor IDs to the schema minimum (#2454)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package hub
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@@ -21,7 +22,8 @@ func generateMonitorID(systemId string, config monitor.Config) string {
|
||||
if config.Protocol == "dns" {
|
||||
args = append(args, config.Server)
|
||||
}
|
||||
return systems.MakeStableHashId(args...)
|
||||
// Meet the record ID minimum without changing existing IDs of six or more characters.
|
||||
return fmt.Sprintf("%06s", systems.MakeStableHashId(args...))
|
||||
}
|
||||
|
||||
// bindNetworkMonitorsEvents keeps monitor records and agent monitor state in sync.
|
||||
|
||||
Reference in New Issue
Block a user