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
Labels
Merge Requests
18
Merge Requests
18
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
jio
Commits
23242819
Commit
23242819
authored
Jul 17, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gidstorage.js put method done
parent
63d104a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
15 deletions
+30
-15
src/jio.storage/gidstorage.js
src/jio.storage/gidstorage.js
+30
-15
No files found.
src/jio.storage/gidstorage.js
View file @
23242819
...
@@ -296,7 +296,7 @@
...
@@ -296,7 +296,7 @@
};
};
};
};
that
.
post
=
function
(
comman
d
)
{
priv
.
putOrPost
=
function
(
command
,
metho
d
)
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
var
gid
,
complex_query
,
doc
=
command
.
cloneDoc
();
var
gid
,
complex_query
,
doc
=
command
.
cloneDoc
();
gid
=
gidFormat
(
doc
,
priv
.
constraints
);
gid
=
gidFormat
(
doc
,
priv
.
constraints
);
...
@@ -305,7 +305,7 @@
...
@@ -305,7 +305,7 @@
"
status
"
:
409
,
"
status
"
:
409
,
"
statusText
"
:
"
Conflict
"
,
"
statusText
"
:
"
Conflict
"
,
"
error
"
:
"
conflict
"
,
"
error
"
:
"
conflict
"
,
"
message
"
:
"
Cannot
post
document
"
,
"
message
"
:
"
Cannot
"
+
method
+
"
document
"
,
"
reason
"
:
"
metadata should respect constraints
"
"
reason
"
:
"
metadata should respect constraints
"
});
});
}
}
...
@@ -314,8 +314,9 @@
...
@@ -314,8 +314,9 @@
"
query
"
:
complex_query
,
"
query
"
:
complex_query
,
"
wildcard_character
"
:
null
"
wildcard_character
"
:
null
},
function
(
response
)
{
},
function
(
response
)
{
var
doc
;
var
doc
,
update_method
=
method
;
if
(
response
.
total_rows
!==
0
)
{
if
(
response
.
total_rows
!==
0
)
{
if
(
method
===
'
post
'
)
{
return
that
.
error
({
return
that
.
error
({
"
status
"
:
409
,
"
status
"
:
409
,
"
statusText
"
:
"
Conflict
"
,
"
statusText
"
:
"
Conflict
"
,
...
@@ -323,24 +324,38 @@
...
@@ -323,24 +324,38 @@
"
message
"
:
"
Cannot post document
"
,
"
message
"
:
"
Cannot post document
"
,
"
reason
"
:
"
Document already exist
"
"
reason
"
:
"
Document already exist
"
});
});
}
else
{
doc
=
command
.
cloneDoc
();
doc
.
_id
=
response
.
rows
[
0
].
id
;
}
}
}
else
{
doc
=
command
.
cloneDoc
();
doc
=
command
.
cloneDoc
();
delete
doc
.
_id
;
delete
doc
.
_id
;
that
.
addJob
(
'
post
'
,
priv
.
sub_storage
,
doc
,
{
update_method
=
'
post
'
;
}
that
.
addJob
(
update_method
,
priv
.
sub_storage
,
doc
,
{
},
function
(
response
)
{
},
function
(
response
)
{
response
.
id
=
gid
;
response
.
id
=
gid
;
that
.
success
(
response
);
that
.
success
(
response
);
},
function
(
err
)
{
},
function
(
err
)
{
err
.
message
=
"
Cannot
post
document
"
;
err
.
message
=
"
Cannot
"
+
method
+
"
document
"
;
that
.
error
(
err
);
that
.
error
(
err
);
});
});
},
function
(
err
)
{
},
function
(
err
)
{
err
.
message
=
"
Cannot
post
document
"
;
err
.
message
=
"
Cannot
"
+
method
+
"
document
"
;
that
.
error
(
err
);
that
.
error
(
err
);
});
});
});
});
};
};
that
.
post
=
function
(
command
)
{
priv
.
putOrPost
(
command
,
'
post
'
);
};
that
.
put
=
function
(
command
)
{
priv
.
putOrPost
(
command
,
'
put
'
);
};
that
.
get
=
function
(
command
)
{
that
.
get
=
function
(
command
)
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
var
gid_object
,
complex_query
;
var
gid_object
,
complex_query
;
...
...
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