mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-03-16 17:54:07 +01:00
fixed issue w/ buffer blocking on write to websocket
This commit is contained in:
@@ -22,7 +22,9 @@ func (b *Buffer) Write(p []byte) (n int, err error) {
|
||||
}
|
||||
|
||||
func (b *Buffer) WriteString(s string) (n int, err error) {
|
||||
return b.Write([]byte(s))
|
||||
n, err = b.buf.WriteString(s)
|
||||
b.channel.Publish([]byte(s))
|
||||
return
|
||||
}
|
||||
|
||||
func (b *Buffer) Bytes() []byte {
|
||||
|
||||
@@ -29,8 +29,7 @@ func NewChannel(opts *Opts) *Channel {
|
||||
}
|
||||
|
||||
func (c *Channel) Publish(data interface{}) {
|
||||
c.broadcast <- data
|
||||
return
|
||||
go func() { c.broadcast <- data }()
|
||||
}
|
||||
|
||||
func (c *Channel) Subscribe() *Subscription {
|
||||
|
||||
Reference in New Issue
Block a user