Skip to content

Commit

Permalink
Update main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
ronanww authored Aug 29, 2023
1 parent a7b8703 commit e87b882
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gcs-fetcher/cmd/gcs-fetcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
)

const (
stagingFolder = ".download/"
userAgent = "gcs-fetcher"
)

Expand All @@ -48,6 +47,9 @@ var (
backoff = flag.Duration("backoff", 100*time.Millisecond, "Time to wait when retrying, will be doubled on each retry.")
timeoutGCS = flag.Bool("timeout_gcs", true, "If true, a timeout will be used to avoid GCS longtails.")
help = flag.Bool("help", false, "If true, prints help text and exits.")

keepSource = flag.Bool("keep_source", false, "If true, keeps the source file in the file system.")
stagingFolder = flag.String("staging_folder", ".download/", "Temp folder where to download the source file.")
)

func logFatalf(writer io.Writer, format string, a ...interface{}) {
Expand Down Expand Up @@ -103,7 +105,7 @@ func main() {
GCS: realGCS{client},
OS: realOS{},
DestDir: *destDir,
StagingDir: filepath.Join(*destDir, stagingFolder),
StagingDir: filepath.Join(*destDir, *stagingFolder),
CreatedDirs: map[string]bool{},
Bucket: bucket,
Object: object,
Expand All @@ -113,6 +115,7 @@ func main() {
Retries: *retries,
Backoff: *backoff,
SourceType: *sourceType,
KeepSource: *keepSource,
Verbose: *verbose,
Stdout: stdout,
Stderr: stderr,
Expand Down

0 comments on commit e87b882

Please sign in to comment.