mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
feat: add keys to organization provision daemons (#14627)
This commit is contained in:
@ -2,7 +2,6 @@ package healthcheck
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"golang.org/x/mod/semver"
|
||||
@ -80,23 +79,10 @@ func (r *ProvisionerDaemonsReport) Run(ctx context.Context, opts *ProvisionerDae
|
||||
return
|
||||
}
|
||||
|
||||
// Ensure stable order for display and for tests
|
||||
sort.Slice(daemons, func(i, j int) bool {
|
||||
return daemons[i].Name < daemons[j].Name
|
||||
})
|
||||
|
||||
for _, daemon := range daemons {
|
||||
// Daemon never connected, skip.
|
||||
if !daemon.LastSeenAt.Valid {
|
||||
continue
|
||||
}
|
||||
// Daemon has gone away, skip.
|
||||
if now.Sub(daemon.LastSeenAt.Time) > (opts.StaleInterval) {
|
||||
continue
|
||||
}
|
||||
|
||||
recentDaemons := db2sdk.RecentProvisionerDaemons(now, opts.StaleInterval, daemons)
|
||||
for _, daemon := range recentDaemons {
|
||||
it := healthsdk.ProvisionerDaemonsReportItem{
|
||||
ProvisionerDaemon: db2sdk.ProvisionerDaemon(daemon),
|
||||
ProvisionerDaemon: daemon,
|
||||
Warnings: make([]health.Message, 0),
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user