55 "os"
66 "path/filepath"
77 "strings"
8- "time"
98
109 "gitlab-sync/internal/mirroring"
1110 "gitlab-sync/internal/utils"
2221func 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
0 commit comments