Skip to content

Commit

Permalink
auto jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
stelzo committed Feb 9, 2025
1 parent 4e789f3 commit 3eb3653
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion images.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,9 @@ func DownloadImagesLauncher(hashJson *ankabuffer.Manifest, bin int, maxConcurren
feedbackWg.Wait()
}()

feedbacks <- "⬇️ in parallel"
if maxConcurrentDownloads > 0 {
feedbacks <- "⬇️ in parallel"
}

semaphore := make(chan struct{}, maxConcurrentDownloads)
errorChan := make(chan error, totalDownloads)
Expand Down
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func main() {
rootCmd.PersistentFlags().StringP("release", "r", "dofus3", "Which Game release version type to use. Available: 'main', 'beta', 'dofus3'.")
rootCmd.PersistentFlags().StringP("output", "o", "./data", "Working folder for output or input.")
rootCmd.PersistentFlags().String("manifest", "", "Manifest file path. Empty will download it if it is not found.")
rootCmd.PersistentFlags().IntP("jobs", "j", 1, "Number of workers to use when things can run in parallel. High numbers on small machines can cause issues with RAM or Docker.")
rootCmd.PersistentFlags().IntP("jobs", "j", 0, "Number of workers to use when things can run in parallel. 0 will automatically scale with your systems CPU cores. High numbers on small machines can cause issues with RAM or Docker.")
rootCmd.PersistentFlags().StringArrayP("ignore", "i", []string{}, `Exclude categories of content from download and unpacking. Below are the categories available for both Dofus 2 and Dofus 3.
Join them with a '-'. Example: --i images-items --i data-language.
Expand Down Expand Up @@ -496,6 +496,10 @@ func rootCommand(ccmd *cobra.Command, args []string) {
log.Fatal(err)
}

if workers == 0 {
workers = runtime.NumCPU()
}

ignore, err := ccmd.Flags().GetStringArray("ignore")
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit 3eb3653

Please sign in to comment.