Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout #160

Merged
merged 1 commit into from
Feb 1, 2019
Merged

Timeout #160

merged 1 commit into from
Feb 1, 2019

Conversation

kornelski
Copy link
Contributor

(requires #158)

Short timeouts didn't work well with large images, because the timeout was checked rarely.

This adds more checks of deadline.passed()

@shssoichiro
Copy link
Owner

Looks like some merge conflicts were introduced after merging #158

@kornelski
Copy link
Contributor Author

Rebased

@shssoichiro
Copy link
Owner

Sorry, one more from merging #162. :)

@@ -341,6 +341,8 @@ pub fn optimize(input: &InFile, output: &OutFile, opts: &Options) -> PngResult<(
eprintln!("Processing: {}", input);
}

let deadline = Arc::new(Deadline::new(opts.timeout, opts.verbosity.is_some()));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make more sense to instantiate the Deadline (here and on 443) inside optimize_png to avoid the duplication?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It starts counting time from when it's instantiated, and I wanted it to also include time it takes to load the image.

@shssoichiro shssoichiro merged commit dad6230 into shssoichiro:master Feb 1, 2019
@kornelski kornelski deleted the timeout branch February 2, 2019 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants