fix: #471 - action activity it not broadcasted to all clients

This commit is contained in:
jamesread
2025-11-05 09:08:04 +00:00
parent 2735793a44
commit 4e7273b616
2 changed files with 69 additions and 30 deletions

View File

@@ -132,9 +132,9 @@ func DefaultExecutor(cfg *config.Config) *Executor {
}
type listener interface {
OnExecutionStarted(logEntry *InternalLogEntry)
OnExecutionFinished(logEntry *InternalLogEntry)
OnOutputChunk(o []byte, executionTrackingId string)
OnExecutionStarted(logEntry *InternalLogEntry, action *config.Action)
OnExecutionFinished(logEntry *InternalLogEntry, action *config.Action)
OnOutputChunk(o []byte, executionTrackingId string, logEntry *InternalLogEntry, action *config.Action)
OnActionMapRebuilt()
}
@@ -509,13 +509,13 @@ func stepLogFinish(req *ExecutionRequest) bool {
func notifyListenersFinished(req *ExecutionRequest) {
for _, listener := range req.executor.listeners {
listener.OnExecutionFinished(req.logEntry)
listener.OnExecutionFinished(req.logEntry, req.Action)
}
}
func notifyListenersStarted(req *ExecutionRequest) {
for _, listener := range req.executor.listeners {
listener.OnExecutionStarted(req.logEntry)
listener.OnExecutionStarted(req.logEntry, req.Action)
}
}
@@ -532,7 +532,7 @@ type OutputStreamer struct {
func (ost *OutputStreamer) Write(o []byte) (n int, err error) {
for _, listener := range ost.Req.executor.listeners {
listener.OnOutputChunk(o, ost.Req.TrackingID)
listener.OnOutputChunk(o, ost.Req.TrackingID, ost.Req.logEntry, ost.Req.Action)
}
return ost.output.Write(o)