Skip to content

Commit

Permalink
Accept timeout parameter given as a query parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 20, 2015
1 parent 212e469 commit 4c42bb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/adapter/api/droonga.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
onRequest: function(request, connection) {
var messageType = pathToMessageType(request.params[0]);
var body = {};
body.timeout = body.timeout || DEFAULT_TIMEOUT;
body.timeout = body.timeout || request.query.timeout || DEFAULT_TIMEOUT;
connection.emit(messageType, body);
}
}),
Expand All @@ -32,7 +32,7 @@ module.exports = {
});
request.on('end', function() {
body = JSON.parse(body);
body.timeout = body.timeout || DEFAULT_TIMEOUT;
body.timeout = body.timeout || request.query.timeout || DEFAULT_TIMEOUT;
body.type = body.type || 'droonga-' + messageType;
connection.emit(messageType, body);
});
Expand Down

0 comments on commit 4c42bb0

Please sign in to comment.