Refactor Oc-Sheduler
This commit is contained in:
4
ws.go
4
ws.go
@@ -27,7 +27,7 @@ func main() {
|
||||
token := ""
|
||||
// Body JSON envoyé comme premier message WebSocket (WorkflowSchedule).
|
||||
// Seuls start + duration_s sont requis si as_possible=true.
|
||||
body := `{"start":"` + time.Now().UTC().Format(time.RFC3339) + `","duration_s":3600}`
|
||||
body := `{"start":"` + time.Now().UTC().Format(time.RFC3339) + `"}`
|
||||
|
||||
if len(args) >= 1 {
|
||||
url = args[0]
|
||||
@@ -104,7 +104,7 @@ func main() {
|
||||
return
|
||||
case <-dateChangeTick.C:
|
||||
newStart := time.Now().UTC().Add(3 * time.Minute)
|
||||
update := `{"start":"` + newStart.Format(time.RFC3339) + `","duration_s":3600}`
|
||||
update := `{"start":"` + newStart.Format(time.RFC3339) + `"}`
|
||||
fmt.Printf("\n[sim] Envoi mise à jour de date → %s\n\n", update)
|
||||
if err := websocket.Message.Send(ws, update); err != nil {
|
||||
fmt.Printf("Erreur envoi mise à jour : %v\n", err)
|
||||
|
||||
Reference in New Issue
Block a user