Skip to content

Commit d8175a6

Browse files
kylecarbssreya
authored andcommitted
fix: surround agentTokenToLogger with mutex
Fixes #15
1 parent f5c11e8 commit d8175a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

logger.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,9 @@ func (p *podEventLogger) init() error {
300300
// If a logger already exists for the token, it's returned. Otherwise a new
301301
// logger is created and returned.
302302
func (p *podEventLogger) sendLog(resourceName, token string, log agentsdk.StartupLog) {
303+
p.mutex.Lock()
303304
logger, ok := p.agentTokenToLogger[token]
305+
p.mutex.Unlock()
304306
if !ok {
305307
client := agentsdk.New(p.coderURL)
306308
client.SetSessionToken(token)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy