Skip to content

Commit

Permalink
Fix threads count
Browse files Browse the repository at this point in the history
  • Loading branch information
Paramtamtam committed Oct 11, 2019
1 parent 530cbba commit 8ba8922
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].

## v0.0.3

### Fixed

- Threads count now depends on total files count _(threads count cannot be grater then total files count)_

## v0.0.2

### Changed
Expand Down
Binary file removed src/2019-06-02 13-57-43.JPG
Binary file not shown.
7 changes: 6 additions & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

const (
AppVersion = "0.0.2"
AppVersion = "0.0.3"
)

type Options struct {
Expand Down Expand Up @@ -81,6 +81,11 @@ func main() {
// Check for files found
if filesLen := len(files); filesLen >= 1 {
infoLog.Println("Found files:", color.BrightYellow(filesLen))

// Set lower threads count if files count less then passed threads count
if filesLen < options.Threads {
options.Threads = filesLen
}
} else {
errorsLog.Fatal(color.BrightRed("Files for processing was not found"))
}
Expand Down

0 comments on commit 8ba8922

Please sign in to comment.