Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurélien Vermylen
jio
Commits
7c4c8878
Commit
7c4c8878
authored
May 19, 2017
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ReplicateStorage: remove one useless signature_storage.allAttachments call
parent
4f466b0c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
30 deletions
+40
-30
src/jio.storage/replicatestorage.js
src/jio.storage/replicatestorage.js
+40
-30
No files found.
src/jio.storage/replicatestorage.js
View file @
7c4c8878
...
@@ -472,46 +472,32 @@
...
@@ -472,46 +472,32 @@
function
pushDocumentAttachment
(
context
,
function
pushDocumentAttachment
(
context
,
skip_attachment_dict
,
id
,
source
,
skip_attachment_dict
,
id
,
source
,
destination
,
destination
,
signature_allAttachments
,
options
)
{
options
)
{
var
queue
=
new
RSVP
.
Queue
(),
var
local_dict
=
{},
local_dict
=
{},
signature_dict
=
{};
signature_dict
=
{};
return
queue
return
source
.
allAttachments
(
id
)
.
push
(
function
()
{
return
RSVP
.
all
([
source
.
allAttachments
(
id
)
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
if
((
error
instanceof
jIO
.
util
.
jIOError
)
&&
if
((
error
instanceof
jIO
.
util
.
jIOError
)
&&
(
error
.
status_code
===
404
))
{
(
error
.
status_code
===
404
))
{
return
{};
return
{};
}
}
throw
error
;
throw
error
;
}),
context
.
_signature_sub_storage
.
allAttachments
(
id
)
.
push
(
undefined
,
function
(
error
)
{
if
((
error
instanceof
jIO
.
util
.
jIOError
)
&&
(
error
.
status_code
===
404
))
{
return
{};
}
throw
error
;
})
]);
})
})
.
push
(
function
(
result_list
)
{
.
push
(
function
(
source_allAttachments
)
{
var
is_modification
,
var
is_modification
,
is_creation
,
is_creation
,
key
,
key
,
argument_list
=
[];
argument_list
=
[];
for
(
key
in
result_list
[
0
]
)
{
for
(
key
in
source_allAttachments
)
{
if
(
result_list
[
0
]
.
hasOwnProperty
(
key
))
{
if
(
source_allAttachments
.
hasOwnProperty
(
key
))
{
if
(
!
skip_attachment_dict
.
hasOwnProperty
(
key
))
{
if
(
!
skip_attachment_dict
.
hasOwnProperty
(
key
))
{
local_dict
[
key
]
=
null
;
local_dict
[
key
]
=
null
;
}
}
}
}
}
}
for
(
key
in
result_list
[
1
]
)
{
for
(
key
in
signature_allAttachments
)
{
if
(
result_list
[
1
]
.
hasOwnProperty
(
key
))
{
if
(
signature_allAttachments
.
hasOwnProperty
(
key
))
{
if
(
!
skip_attachment_dict
.
hasOwnProperty
(
key
))
{
if
(
!
skip_attachment_dict
.
hasOwnProperty
(
key
))
{
signature_dict
[
key
]
=
null
;
signature_dict
[
key
]
=
null
;
}
}
...
@@ -576,6 +562,24 @@
...
@@ -576,6 +562,24 @@
var
skip_attachment_dict
=
{};
var
skip_attachment_dict
=
{};
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
if
(
context
.
_check_local_attachment_modification
||
context
.
_check_local_attachment_creation
||
context
.
_check_local_attachment_deletion
||
context
.
_check_remote_attachment_modification
||
context
.
_check_remote_attachment_creation
||
context
.
_check_remote_attachment_deletion
)
{
return
context
.
_signature_sub_storage
.
allAttachments
(
id
);
}
return
{};
})
.
push
(
undefined
,
function
(
error
)
{
if
((
error
instanceof
jIO
.
util
.
jIOError
)
&&
(
error
.
status_code
===
404
))
{
return
{};
}
throw
error
;
})
.
push
(
function
(
signature_allAttachments
)
{
if
(
context
.
_check_local_attachment_modification
||
if
(
context
.
_check_local_attachment_modification
||
context
.
_check_local_attachment_creation
||
context
.
_check_local_attachment_creation
||
context
.
_check_local_attachment_deletion
)
{
context
.
_check_local_attachment_deletion
)
{
...
@@ -585,6 +589,7 @@
...
@@ -585,6 +589,7 @@
id
,
id
,
context
.
_local_sub_storage
,
context
.
_local_sub_storage
,
context
.
_remote_sub_storage
,
context
.
_remote_sub_storage
,
signature_allAttachments
,
{
{
conflict_force
:
(
context
.
_conflict_handling
===
conflict_force
:
(
context
.
_conflict_handling
===
CONFLICT_KEEP_LOCAL
),
CONFLICT_KEEP_LOCAL
),
...
@@ -597,10 +602,14 @@
...
@@ -597,10 +602,14 @@
check_creation
:
context
.
_check_local_attachment_creation
,
check_creation
:
context
.
_check_local_attachment_creation
,
check_deletion
:
context
.
_check_local_attachment_deletion
check_deletion
:
context
.
_check_local_attachment_deletion
}
}
);
)
.
push
(
function
()
{
return
signature_allAttachments
;
});
}
}
return
signature_allAttachments
;
})
})
.
push
(
function
()
{
.
push
(
function
(
signature_allAttachments
)
{
if
(
context
.
_check_remote_attachment_modification
||
if
(
context
.
_check_remote_attachment_modification
||
context
.
_check_remote_attachment_creation
||
context
.
_check_remote_attachment_creation
||
context
.
_check_remote_attachment_deletion
)
{
context
.
_check_remote_attachment_deletion
)
{
...
@@ -610,6 +619,7 @@
...
@@ -610,6 +619,7 @@
id
,
id
,
context
.
_remote_sub_storage
,
context
.
_remote_sub_storage
,
context
.
_local_sub_storage
,
context
.
_local_sub_storage
,
signature_allAttachments
,
{
{
use_revert_post
:
context
.
_use_remote_post
,
use_revert_post
:
context
.
_use_remote_post
,
conflict_force
:
(
context
.
_conflict_handling
===
conflict_force
:
(
context
.
_conflict_handling
===
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment