Skip to content

Commit 43ffe7d

Browse files
committed
Remove waiting delays for notifying hooks
1 parent 060b79c commit 43ffe7d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

internal/app/engine/engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ func (e *Engine) processChange(change *statemachine.Change) (newChanges []*state
314314
log.Println("Notify hook ", name)
315315
select {
316316
case hook <- hookOut:
317-
case <-time.After(500 * time.Millisecond):
317+
default:
318318
log.Printf("Hook %v unresponsive! Failed to sent %v", name, hookOut)
319319
}
320320
}

internal/app/engine/process_tick.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (e *Engine) processTick() {
7171
for hookId, hook := range e.hooks {
7272
select {
7373
case hook <- hookOut:
74-
case <-time.After(1 * time.Second):
74+
default:
7575
log.Printf("processTick: Hook %v unresponsive! Failed to sent %v", hookId, hookOut)
7676
}
7777
}

internal/app/publish/messagegenerator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type MessageGenerator struct {
2121
// NewPublisher creates a new publisher that publishes referee messages via UDP to the teams
2222
func NewMessageGenerator() (m *MessageGenerator) {
2323
m = new(MessageGenerator)
24-
m.EngineHook = make(chan engine.HookOut)
24+
m.EngineHook = make(chan engine.HookOut, 10)
2525
m.goal = map[state.Team]bool{}
2626
m.goal[state.Team_BLUE] = false
2727
m.goal[state.Team_YELLOW] = false

0 commit comments

Comments
 (0)