Merge pull request #231 from whym/threadsafe-finduniquefilename

Safeguard findUniqueFilename from race conditions
This commit is contained in:
Nicolas Raoul 2016-08-15 22:29:20 +09:00 committed by GitHub
commit 48a6ee49e2

View file

@ -284,7 +284,7 @@ public class UploadService extends HandlerService<Contribution> {
contribution.save();
}
private String findUniqueFilename(String fileName) throws IOException {
synchronized private String findUniqueFilename(String fileName) throws IOException {
return findUniqueFilename(fileName, 1);
}