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
Kirill Smelkov
jio
Commits
c0c9301e
Commit
c0c9301e
authored
Apr 09, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allDocs optimization
parent
d4e4af04
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
src/jio.storage/replicatestorage.js
src/jio.storage/replicatestorage.js
+20
-20
No files found.
src/jio.storage/replicatestorage.js
View file @
c0c9301e
...
@@ -521,23 +521,23 @@
...
@@ -521,23 +521,23 @@
};
};
ReplicateStorage
.
prototype
.
allDocs
=
function
(
command
,
param
,
option
)
{
ReplicateStorage
.
prototype
.
allDocs
=
function
(
command
,
param
,
option
)
{
/*jslint unparam: true */
var
promise_list
=
[],
index
,
length
=
this
.
_storage_list
.
length
;
var
promise_list
=
[],
index
,
length
=
this
.
_storage_list
.
length
;
for
(
index
=
0
;
index
<
length
;
index
+=
1
)
{
for
(
index
=
0
;
index
<
length
;
index
+=
1
)
{
promise_list
[
index
]
=
promise_list
[
index
]
=
success
(
command
.
storage
(
this
.
_storage_list
[
index
]).
allDocs
(
option
));
success
(
command
.
storage
(
this
.
_storage_list
[
index
]).
allDocs
(
option
));
}
}
sequence
([
function
()
{
all
(
promise_list
).
then
(
function
(
answers
)
{
return
all
(
promise_list
);
},
function
(
answers
)
{
// merge responses
// merge responses
var
i
,
j
,
k
,
found
,
rows
;
var
i
,
j
,
k
,
found
,
rows
;
// browsing answers
// browsing answers
for
(
i
=
0
;
i
<
answers
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
answers
.
length
;
i
+=
1
)
{
if
(
answers
[
i
].
result
===
"
success
"
)
{
if
(
answers
[
i
].
result
===
"
success
"
)
{
if
(
!
rows
)
{
rows
=
answers
[
i
].
data
.
rows
;
rows
=
answers
[
i
].
data
.
rows
;
}
else
{
break
;
}
}
for
(
i
+=
1
;
i
<
answers
.
length
;
i
+=
1
)
{
if
(
answers
[
i
].
result
===
"
success
"
)
{
// browsing answer rows
// browsing answer rows
for
(
j
=
0
;
j
<
answers
[
i
].
data
.
rows
.
length
;
j
+=
1
)
{
for
(
j
=
0
;
j
<
answers
[
i
].
data
.
rows
.
length
;
j
+=
1
)
{
found
=
false
;
found
=
false
;
...
@@ -554,9 +554,9 @@
...
@@ -554,9 +554,9 @@
}
}
}
}
}
}
}
return
{
"
data
"
:
{
"
total_rows
"
:
(
rows
||
[]).
length
,
"
rows
"
:
rows
||
[]}};
return
{
"
data
"
:
{
"
total_rows
"
:
(
rows
||
[]).
length
,
"
rows
"
:
rows
||
[]}};
},
[
command
.
success
,
command
.
error
]]);
}).
then
(
command
.
success
,
command
.
error
,
command
.
notify
);
/*jslint unparam: true */
};
};
ReplicateStorage
.
prototype
.
check
=
function
(
command
,
param
,
option
)
{
ReplicateStorage
.
prototype
.
check
=
function
(
command
,
param
,
option
)
{
...
...
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