Skip to content

Commit 67ca4d6

Browse files
committed
fix: remove unused timeout option
1 parent adbdfdb commit 67ca4d6

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

cmd/main.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"os"
66
"path/filepath"
77
"strings"
8-
"time"
98

109
"gitlab-sync/internal/mirroring"
1110
"gitlab-sync/internal/utils"
@@ -22,7 +21,6 @@ var (
2221
func main() {
2322
var args utils.ParserArgs
2423
var mirrorMappingPath string
25-
var timeout int
2624
var logFile string
2725

2826
var rootCmd = &cobra.Command{
@@ -44,12 +42,6 @@ func main() {
4442
zap.L().Fatal("retry count must be -1 (no limit) or strictly greater than 0")
4543
}
4644

47-
// Set the timeout for GitLab API requests
48-
if timeout < 0 {
49-
timeout = 0
50-
}
51-
args.Timeout = time.Duration(timeout) * time.Second
52-
5345
// Check if the source GitLab URL is provided
5446
args.SourceGitlabURL = promptForMandatoryInput(args.SourceGitlabURL, "Input Source GitLab URL (MANDATORY)", "Source GitLab URL is mandatory", "Source GitLab URL", args.NoPrompt, false)
5547

@@ -89,7 +81,6 @@ func main() {
8981
rootCmd.Flags().BoolVarP(&args.NoPrompt, "no-prompt", "n", strings.TrimSpace(os.Getenv("NO_PROMPT")) != "", "Disable prompting for missing values")
9082
rootCmd.Flags().StringVar(&mirrorMappingPath, "mirror-mapping", os.Getenv("MIRROR_MAPPING"), "Path to the mirror mapping file")
9183
rootCmd.Flags().BoolVar(&args.DryRun, "dry-run", false, "Perform a dry run without making any changes")
92-
rootCmd.Flags().IntVarP(&timeout, "timeout", "t", 30, "Timeout in seconds for GitLab API requests")
9384
rootCmd.Flags().IntVarP(&args.Retry, "retry", "r", 3, "Number of retries for failed requests")
9485
rootCmd.Flags().StringVar(&logFile, "log-file", strings.TrimSpace(os.Getenv("GITLAB_SYNC_LOG_FILE")), "Path to the log file")
9586

internal/utils/types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"path/filepath"
1212
"strings"
1313
"sync"
14-
"time"
1514

1615
gitlab "gitlab.com/gitlab-org/api/client-go"
1716
)
@@ -31,7 +30,6 @@ const (
3130
// - no_prompt: whether to disable prompts
3231
// - dry_run: whether to perform a dry run
3332
// - version: whether to show the version
34-
// - timeout: the timeout for the GitLab API requests
3533
// - retry: the number of retries for the GitLab API requests
3634
type ParserArgs struct {
3735
SourceGitlabURL string
@@ -44,7 +42,6 @@ type ParserArgs struct {
4442
Verbose bool
4543
NoPrompt bool
4644
DryRun bool
47-
Timeout time.Duration
4845
Retry int
4946
}
5047

0 commit comments

Comments
 (0)