Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd41e0b0

Browse files
committed
review
1 parentea60da6 commitd41e0b0

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

‎coderd/agentapi/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (a *LogsAPI) BatchCreateLogs(ctx context.Context, req *agentproto.BatchCrea
144144
ifworkspaceAgent.LogsLength==0&&a.PublishWorkspaceUpdateFn!=nil {
145145
// If these are the first logs being appended, we publish a UI update
146146
// to notify the UI that logs are now available.
147-
err=a.PublishWorkspaceUpdateFn(ctx,&workspaceAgent,wspubsub.WorkspaceEventKindAgentLogsUpdate)
147+
err=a.PublishWorkspaceUpdateFn(ctx,&workspaceAgent,wspubsub.WorkspaceEventKindAgentFirstLogs)
148148
iferr!=nil {
149149
returnnil,xerrors.Errorf("publish workspace update: %w",err)
150150
}

‎coderd/workspaceagents.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ func (api *API) patchWorkspaceAgentLogs(rw http.ResponseWriter, r *http.Request)
252252
}
253253

254254
api.publishWorkspaceUpdate(ctx,workspace.Workspace.OwnerID, wspubsub.WorkspaceEvent{
255-
Kind:wspubsub.WorkspaceEventKindAgentLogsUpdate,
255+
Kind:wspubsub.WorkspaceEventKindAgentLogsOverflow,
256256
WorkspaceID:workspace.Workspace.ID,
257257
AgentID:&workspaceAgent.ID,
258258
})
@@ -284,7 +284,7 @@ func (api *API) patchWorkspaceAgentLogs(rw http.ResponseWriter, r *http.Request)
284284
}
285285

286286
api.publishWorkspaceUpdate(ctx,workspace.Workspace.OwnerID, wspubsub.WorkspaceEvent{
287-
Kind:wspubsub.WorkspaceEventKindAgentLogsUpdate,
287+
Kind:wspubsub.WorkspaceEventKindAgentFirstLogs,
288288
WorkspaceID:workspace.Workspace.ID,
289289
AgentID:&workspaceAgent.ID,
290290
})

‎coderd/workspaces.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,9 +1698,7 @@ func (api *API) watchWorkspace(rw http.ResponseWriter, r *http.Request) {
16981698
defercancelWorkspaceSubscribe()
16991699

17001700
// This is required to show whether the workspace is up-to-date.
1701-
cancelTemplateSubscribe,err:=api.Pubsub.Subscribe(watchTemplateChannel(workspace.TemplateID),func(ctx context.Context,msg []byte) {
1702-
sendUpdate(ctx,nil)
1703-
})
1701+
cancelTemplateSubscribe,err:=api.Pubsub.Subscribe(watchTemplateChannel(workspace.TemplateID),sendUpdate)
17041702
iferr!=nil {
17051703
_=sendEvent(ctx, codersdk.ServerSentEvent{
17061704
Type:codersdk.ServerSentEventTypeError,

‎coderd/wspubsub/wspubsub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ const (
4949
WorkspaceEventKindAppHealthUpdateWorkspaceEventKind="app_health"
5050

5151
WorkspaceEventKindAgentLifecycleUpdateWorkspaceEventKind="agt_lifecycle_update"
52-
WorkspaceEventKindAgentLogsUpdateWorkspaceEventKind="agt_logs_update"
5352
WorkspaceEventKindAgentConnectionUpdateWorkspaceEventKind="agt_connection_update"
53+
WorkspaceEventKindAgentFirstLogsWorkspaceEventKind="agt_first_logs"
5454
WorkspaceEventKindAgentLogsOverflowWorkspaceEventKind="agt_logs_overflow"
5555
WorkspaceEventKindAgentTimeoutWorkspaceEventKind="agt_timeout"
5656
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp