fix(enterprise/coderd): make primary workspace proxy always be updatd now (#11499)

This commit is contained in:
Cian Johnston
2024-01-09 10:03:08 +00:00
committed by GitHub
parent fb29af664b
commit 0c953b4b8c
2 changed files with 22 additions and 2 deletions

View File

@ -930,6 +930,7 @@ func convertRegion(proxy database.WorkspaceProxy, status proxyhealth.ProxyStatus
}
func convertProxy(p database.WorkspaceProxy, status proxyhealth.ProxyStatus) codersdk.WorkspaceProxy {
now := dbtime.Now()
if p.IsPrimary() {
// Primary is always healthy since the primary serves the api that this
// is returned from.
@ -939,8 +940,11 @@ func convertProxy(p database.WorkspaceProxy, status proxyhealth.ProxyStatus) cod
ProxyHost: u.Host,
Status: proxyhealth.Healthy,
Report: codersdk.ProxyHealthReport{},
CheckedAt: time.Now(),
CheckedAt: now,
}
// For primary, created at / updated at are always 'now'
p.CreatedAt = now
p.UpdatedAt = now
}
if status.Status == "" {
status.Status = proxyhealth.Unknown