mirror of
https://github.com/bettercap/bettercap.git
synced 2025-03-12 04:36:03 -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
@ -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…
x
Reference in New Issue
Block a user