Merge lp:~threeve/ubuntuone-ios-files/fix-duplicate-uploads-folder into lp:ubuntuone-ios-files

Proposed by Jason Foreman
Status: Merged
Approved by: Zachery Bir
Approved revision: 28
Merged at revision: 33
Proposed branch: lp:~threeve/ubuntuone-ios-files/fix-duplicate-uploads-folder
Merge into: lp:ubuntuone-ios-files
Diff against target: 20 lines (+8/-0)
1 file modified
Files/U1AutoUploadsManager.m (+8/-0)
To merge this branch: bzr merge lp:~threeve/ubuntuone-ios-files/fix-duplicate-uploads-folder
Reviewer Review Type Date Requested Status
Zachery Bir Approve
Review via email: mp+84668@code.launchpad.net

Description of the change

Fix a case where multiple requests to create the auto-uploads volume would be sent simultaneously.

To post a comment you must log in.
Revision history for this message
Zachery Bir (urbanape) wrote :

Land it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Files/U1AutoUploadsManager.m'
2--- Files/U1AutoUploadsManager.m 2011-12-06 19:44:22 +0000
3+++ Files/U1AutoUploadsManager.m 2011-12-06 20:48:24 +0000
4@@ -154,8 +154,16 @@
5 }
6 if (!found)
7 {
8+ static BOOL creatingUploadVolume = NO;
9+
10+ if (creatingUploadVolume)
11+ return;
12+
13+ creatingUploadVolume = YES;
14+
15 [self.filesClient createVolumeAtPath:[self remoteUploadFolderPath]
16 completionBlock:^(U1Volume *volume, NSError *error) {
17+ creatingUploadVolume = NO;
18 if (error == nil)
19 {
20 self.remoteUploadFolder = volume.rootFolder;

Subscribers

People subscribed via source and target branches