Skip to content

Commit a9b570e

Browse files
committed
fix: surround agentTokenToLogger with mutex
Fixes #15
1 parent b661fb8 commit a9b570e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

logger.go

+2
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)