mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
fix(coderd/agentapi): set ReadyAt
for start timeout (#13846)
This commit is contained in:
committed by
GitHub
parent
b07e3069dd
commit
35a808f089
@ -98,7 +98,9 @@ func (a *LifecycleAPI) UpdateLifecycle(ctx context.Context, req *agentproto.Upda
|
||||
// This agent is (re)starting, so it's not ready yet.
|
||||
readyAt.Time = time.Time{}
|
||||
readyAt.Valid = false
|
||||
case database.WorkspaceAgentLifecycleStateReady, database.WorkspaceAgentLifecycleStateStartError:
|
||||
case database.WorkspaceAgentLifecycleStateReady,
|
||||
database.WorkspaceAgentLifecycleStateStartTimeout,
|
||||
database.WorkspaceAgentLifecycleStateStartError:
|
||||
if !startedAt.Valid {
|
||||
startedAt = dbChangedAt
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ func TestUpdateLifecycle(t *testing.T) {
|
||||
if state == agentproto.Lifecycle_STARTING {
|
||||
expectedStartedAt = sql.NullTime{Valid: true, Time: stateNow}
|
||||
}
|
||||
if state == agentproto.Lifecycle_READY || state == agentproto.Lifecycle_START_ERROR {
|
||||
if state == agentproto.Lifecycle_READY || state == agentproto.Lifecycle_START_TIMEOUT || state == agentproto.Lifecycle_START_ERROR {
|
||||
expectedReadyAt = sql.NullTime{Valid: true, Time: stateNow}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user