Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 69aec02

Browse files
committed
Invalidate cache on matrix OS
1 parent 328852a commit 69aec02

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.github/workflows/coder.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ jobs:
138138
~/.cache/go-build
139139
~/Library/Caches/go-build
140140
%LocalAppData%\go-build
141-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
141+
key: ${{ matrix.os }}-go-${{ hashFiles('**/go.sum') }}
142142
restore-keys: |
143-
${{ runner.os }}-go-
143+
${{ matrix.os }}-go-
144144
145145
- run: go install gotest.tools/gotestsum@latest
146146

peer/conn.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,15 @@ func (c *Conn) init() error {
183183
}
184184
})
185185
c.rtc.OnConnectionStateChange(func(peerConnectionState webrtc.PeerConnectionState) {
186-
if c.isClosed() {
187-
// Make sure we don't log after Close() has been called.
188-
return
189-
}
190-
c.opts.Logger.Debug(context.Background(), "rtc connection updated",
191-
slog.F("state", peerConnectionState))
186+
go func() {
187+
c.closeMutex.Lock()
188+
defer c.closeMutex.Unlock()
189+
if c.isClosed() {
190+
return
191+
}
192+
c.opts.Logger.Debug(context.Background(), "rtc connection updated",
193+
slog.F("state", peerConnectionState))
194+
}()
192195

193196
switch peerConnectionState {
194197
case webrtc.PeerConnectionStateDisconnected:

provisionerd/provisionerd.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,13 @@ func (p *provisionerDaemon) connect(ctx context.Context) {
110110
if errors.Is(err, context.Canceled) {
111111
return
112112
}
113+
p.closeMutex.Lock()
113114
if p.isClosed() {
115+
p.closeMutex.Unlock()
114116
return
115117
}
116118
p.opts.Logger.Warn(context.Background(), "failed to dial", slog.Error(err))
119+
p.closeMutex.Unlock()
117120
continue
118121
}
119122
p.opts.Logger.Debug(context.Background(), "connected")

0 commit comments

Comments
 (0)