fix: add delay in OnStackStart for status refresh timing

The goroutine fires immediately but needs the stack manager's
state to reflect 'running' before checking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 20:20:36 +01:00
parent e21ae0f409
commit 74d985b543
@@ -2,6 +2,7 @@ package integrations
import (
"context"
"time"
"gitea.dooplex.hu/admin/felhom-controller/internal/stacks"
)
@@ -56,7 +57,12 @@ func (m *Manager) OnStackStop(_ context.Context, stackName string) {
// OnStackStart is called when a stack starts.
// Re-applies integrations that were previously enabled but are not currently active.
// Waits briefly for the stack manager to refresh container state.
func (m *Manager) OnStackStart(_ context.Context, stackName string) {
// Brief delay so the stack manager's periodic status refresh
// picks up the new container state (runs every 30s).
time.Sleep(5 * time.Second)
m.mu.Lock()
defer m.mu.Unlock()