Skip to content

Commit a0c667d

Browse files
committed
debug: More logging and reduced timeout for engine hooks
1 parent 8b2af68 commit a0c667d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

internal/app/ci/ci.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ func (s *Server) serve(conn net.Conn) {
107107
case <-time.After(1 * time.Second):
108108
log.Printf("tickChan unresponsive! Failed to sent %v", s.latestTime)
109109
}
110+
} else {
111+
log.Println("CiInput without timestamp!")
110112
}
111113
}
112114
}

internal/app/engine/engine.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,17 @@ func (e *Engine) processChange(change *statemachine.Change) {
284284
e.queue <- newChange
285285
}
286286

287+
log.Println("Add entry to state store")
287288
if err := e.stateStore.Add(&entry); err != nil {
288289
log.Println("Could not add new state to store: ", err)
289290
}
290291
stateCopy := e.currentState.Clone()
291292
hookOut := HookOut{Change: entry.Change, State: stateCopy}
292293
for name, hook := range e.hooks {
294+
log.Println("Notify hook ", name)
293295
select {
294296
case hook <- hookOut:
295-
case <-time.After(1 * time.Second):
297+
case <-time.After(500 * time.Millisecond):
296298
log.Printf("Hook %v unresponsive! Failed to sent %v", name, hookOut)
297299
}
298300
}

0 commit comments

Comments
 (0)