feat: Task Health Check + customer_number in webhook payload

- Task model: CustomerNumber field (K-Nummer aus customers.number)
- DB: taskSelectCols joined c.number, scanTask scans CustomerNumber
- Hub: WaitForAgentOnline() polls until agent reconnects or timeout
- Scheduler: executeUpdateWithHealthCheck() waits for agent reconnect after update
  - health_check: {agent_online: bool, checked_at: RFC3339} in result
  - Status: completed_with_warning wenn Update OK aber Agent offline bleibt
- Frontend: Task-Tabelle zeigt Status-Badge (lauft/fehler/warnung/abgebr.)
This commit is contained in:
cynfo3000
2026-03-05 10:53:08 +01:00
parent 721fd5008f
commit d4b6ca86e5
5 changed files with 96 additions and 13 deletions
+13
View File
@@ -175,6 +175,19 @@ func (h *Hub) IsAgentConnected(agentID string) bool {
return exists
}
// WaitForAgentOnline polls until the agent reconnects or timeout is reached.
// Returns true if agent came online within the timeout, false otherwise.
func (h *Hub) WaitForAgentOnline(agentID string, timeout time.Duration) bool {
deadline := time.Now().Add(timeout)
for time.Now().Before(deadline) {
if h.IsAgentConnected(agentID) {
return true
}
time.Sleep(10 * time.Second)
}
return false
}
func (h *Hub) GetConnectedAgents() []string {
h.agentsMux.RLock()
defer h.agentsMux.RUnlock()