Skip to content

Commit

Permalink
removed unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
vadlakondaswetha committed Dec 27, 2024
1 parent b26759d commit c80c0dd
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions internal/bufferedwrites/upload_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"fmt"
"io"
"sync"
"time"

"github.com/googlecloudplatform/gcsfuse/v2/internal/block"
"github.com/googlecloudplatform/gcsfuse/v2/internal/logger"
Expand Down Expand Up @@ -175,21 +174,3 @@ func (uh *UploadHandler) Destroy() {
}
}
}

// TODO: Move this method to util and add unit tests.
// waitTimeout waits for the waitGroup for the specified max timeout.
// Returns true if waiting timed out.
func waitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool {
c := make(chan struct{})
go func() {
defer close(c)
wg.Wait()
}()

select {
case <-c:
return false // completed normally
case <-time.After(timeout):
return true // timed out
}
}

0 comments on commit c80c0dd

Please sign in to comment.