mirror of
https://github.com/bettercap/bettercap
synced 2025-08-01 20:43:59 -07:00
fix: using non blocking channel write ops in order not to spawn too many go routines and fill the stack (fixes #20)
This commit is contained in:
parent
4f1c508a7c
commit
79130e2669
1 changed files with 4 additions and 1 deletions
|
@ -59,7 +59,10 @@ func (p *EventPool) Add(tag string, data interface{}) {
|
|||
e := NewEvent(tag, data)
|
||||
p.events = append([]Event{e}, p.events...)
|
||||
|
||||
go func() { p.NewEvents <- e }()
|
||||
select {
|
||||
case p.NewEvents <- e:
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
func (p *EventPool) Log(level int, format string, args ...interface{}) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue