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

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Invalidate cache on matrix OS
  • Loading branch information
kylecarbs committed Feb 19, 2022
commit 69aec02c66a4531f55b28833be587a7a99268e22
4 changes: 2 additions & 2 deletions .github/workflows/coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ jobs:
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ matrix.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
${{ matrix.os }}-go-

- run: go install gotest.tools/gotestsum@latest

Expand Down
15 changes: 9 additions & 6 deletions peer/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,15 @@ func (c *Conn) init() error {
}
})
c.rtc.OnConnectionStateChange(func(peerConnectionState webrtc.PeerConnectionState) {
if c.isClosed() {
// Make sure we don't log after Close() has been called.
return
}
c.opts.Logger.Debug(context.Background(), "rtc connection updated",
slog.F("state", peerConnectionState))
go func() {
c.closeMutex.Lock()
defer c.closeMutex.Unlock()
if c.isClosed() {
return
}
c.opts.Logger.Debug(context.Background(), "rtc connection updated",
slog.F("state", peerConnectionState))
}()

switch peerConnectionState {
case webrtc.PeerConnectionStateDisconnected:
Expand Down
3 changes: 3 additions & 0 deletions provisionerd/provisionerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,13 @@ func (p *provisionerDaemon) connect(ctx context.Context) {
if errors.Is(err, context.Canceled) {
return
}
p.closeMutex.Lock()
if p.isClosed() {
p.closeMutex.Unlock()
return
}
p.opts.Logger.Warn(context.Background(), "failed to dial", slog.Error(err))
p.closeMutex.Unlock()
continue
}
p.opts.Logger.Debug(context.Background(), "connected")
Expand Down