diff --git a/core/integrations/slicer/endpoints.go b/core/integrations/slicer/endpoints.go index 3770003..0e44e83 100644 --- a/core/integrations/slicer/endpoints.go +++ b/core/integrations/slicer/endpoints.go @@ -11,6 +11,7 @@ import ( "github.com/eduardooliveira/stLib/core/processing" "github.com/eduardooliveira/stLib/core/runtime" "github.com/eduardooliveira/stLib/core/state" + "github.com/eduardooliveira/stLib/core/system" "github.com/labstack/echo/v4" ) @@ -97,5 +98,6 @@ func upload(c echo.Context) error { state.TempFiles[tempFile.UUID] = tempFile } + system.Publish("tempfile.new", map[string]any{"name": name}) return c.NoContent(http.StatusOK) } diff --git a/core/system/eventManagement.go b/core/system/eventManagement.go index eec96da..68c9ba6 100644 --- a/core/system/eventManagement.go +++ b/core/system/eventManagement.go @@ -25,7 +25,7 @@ func (em *eventManagement) OnNewSub() error { } func (em *eventManagement) Read() chan *events.Message { - rtn := make(chan *events.Message, 100) + rtn := make(chan *events.Message, 1) eventName := "system.state" go func() { for { @@ -35,7 +35,7 @@ func (em *eventManagement) Read() chan *events.Message { Event: eventName, Data: m, }: - log.Println("qweqwe") + log.Println("event sent") default: log.Println("status update channel full") }