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

Check for tempdir once #397

Merged
merged 2 commits into from
Feb 21, 2014
Merged

Check for tempdir once #397

merged 2 commits into from
Feb 21, 2014

Conversation

garcia-jj
Copy link
Member

At this time we create a temp file on each time that upload was requested. For applications that have a lot of upload requests, application may stay slow.

So with this change we create a temp file once, and store the reference in a attribute.

@@ -50,12 +51,14 @@ public long getSizeLimit() {

@Override
public File getDirectory() {
Path tmp = getTemporaryDirectory();
Copy link
Member Author

Choose a reason for hiding this comment

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

We really need to use lock in this block avoiding access by another thread? The only issue if many thread access in same time is check for tmpdir twice.

garcia-jj added a commit that referenced this pull request Feb 21, 2014
@garcia-jj garcia-jj merged commit bd0c6c1 into caelum:master Feb 21, 2014
@garcia-jj garcia-jj deleted the ot-betterupload branch February 21, 2014 03:17
@Turini Turini added this to the 4.0.0-RCF milestone Mar 6, 2014
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.

3 participants