defer 빼먹음;;;

This commit is contained in:
2025-08-05 21:48:12 +09:00
parent fb3f038506
commit 38a3da271a

View File

@ -64,7 +64,7 @@ func (c *Client) Send(ld *LogDocument) {
serialized, _ := json.Marshal(ld)
go func(serialized []byte) {
sending := atomic.AddInt32(&c.sendingCount, 1)
atomic.AddInt32(&c.sendingCount, -1)
defer atomic.AddInt32(&c.sendingCount, -1)
if sending > 100 {
logger.Println("sending log bottleneck :", sending)
@ -102,7 +102,7 @@ func (c *Client) SendBulk(ds map[string]*LogDocument) {
go func(contents string) {
sending := atomic.AddInt32(&c.sendingCount, 1)
atomic.AddInt32(&c.sendingCount, -1)
defer atomic.AddInt32(&c.sendingCount, -1)
if sending > 100 {
logger.Println("sending log bottleneck :", sending)