Skip to content

Commit

Permalink
Addtimeout before read confirmed channels
Browse files Browse the repository at this point in the history
  • Loading branch information
berejant committed Oct 14, 2023
1 parent 9051514 commit 158b334
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions eventloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os/signal"
"runtime"
"syscall"
"time"
)

type EventLoop struct {
Expand All @@ -34,6 +35,7 @@ func (eventLoop *EventLoop) execute() {

go eventLoop.dispatchConfirmedEvent(ctx)
runtime.Gosched()
time.Sleep(time.Millisecond * 300)
eventLoop.dispatchIncomingEvent(ctx)
}

Expand Down
2 changes: 1 addition & 1 deletion eventloop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestEventLoopExecute(t *testing.T) {
currentYearWatcher: currentYearWatcher,
}

timeout := time.After(time.Millisecond * 500)
timeout := time.After(time.Second)
done := make(chan bool)
go func() {
eventLoop.execute()
Expand Down

0 comments on commit 158b334

Please sign in to comment.