Skip to content

Commit

Permalink
Close instead of sending on channel
Browse files Browse the repository at this point in the history
I think that closing the channel makes it clearer that this channels purpose has been fulfilled and it no longer needs to be considered. All the places that use the channel are recieving all values from the channel so they will continue to function in the same way
  • Loading branch information
Alex Vest committed Nov 14, 2023
1 parent db845e8 commit 13a3aad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/server/backuprestoreserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ func handleSsrStopRequest(ctx context.Context, handler *HTTPHandler, ssr *snapsh
ssr.SsrStateMutex.Lock()
if ssr.SsrState == brtypes.SnapshotterActive {
ssr.SsrStateMutex.Unlock()
ssrStopCh <- emptyStruct
close(ssrStopCh)
} else {
ssr.SsrState = brtypes.SnapshotterInactive
ssr.SsrStateMutex.Unlock()
Expand Down

0 comments on commit 13a3aad

Please sign in to comment.