mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-03-11 13:23:06 +01:00
Send NumRunningCommands updates via the main bus, regardless of where other updates are being sent (#545)
This commit is contained in:
parent
ccc63937b6
commit
a139633375
@ -2939,7 +2939,7 @@ func OpenAICommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (scbus
|
||||
return nil, fmt.Errorf("openai error, prompt string is blank")
|
||||
}
|
||||
update := scbus.MakeUpdatePacket()
|
||||
sstore.IncrementNumRunningCmds_Update(update, cmd.ScreenId, 1)
|
||||
go sstore.IncrementNumRunningCmds(cmd.ScreenId, 1)
|
||||
line, err := sstore.AddOpenAILine(ctx, ids.ScreenId, DefaultUserId, cmd)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot add new line: %v", err)
|
||||
@ -3148,7 +3148,7 @@ func addLineForCmd(ctx context.Context, metaCmd string, shouldFocus bool, ids re
|
||||
sstore.AddLineUpdate(update, rtnLine, cmd)
|
||||
update.AddUpdate(*screen)
|
||||
if cmd.Status == sstore.CmdStatusRunning {
|
||||
sstore.IncrementNumRunningCmds_Update(update, cmd.ScreenId, 1)
|
||||
go sstore.IncrementNumRunningCmds(cmd.ScreenId, 1)
|
||||
}
|
||||
updateHistoryContext(ctx, rtnLine, cmd, cmd.FeState)
|
||||
return update, nil
|
||||
|
@ -789,7 +789,7 @@ func UpdateCmdDoneInfo(ctx context.Context, update *scbus.ModelUpdatePacketType,
|
||||
// This is not a fatal error, so just log it
|
||||
log.Printf("error setting status indicator level after done packet: %v\n", err)
|
||||
}
|
||||
IncrementNumRunningCmds_Update(update, screenId, -1)
|
||||
go IncrementNumRunningCmds(screenId, -1)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user