YUKI Hiroshi
null+****@clear*****
Mon Jan 21 14:23:45 JST 2013
YUKI Hiroshi 2013-01-21 14:23:45 +0900 (Mon, 21 Jan 2013) New Revision: 0d7e9ff82a9697f8129c44a40dfab3087081f864 https://github.com/groonga/express-kotoumi/commit/0d7e9ff82a9697f8129c44a40dfab3087081f864 Log: Don't create new connection by REST and Socket.IO adaptors Modified files: lib/rest-adaptor.js lib/socket-adaptor.js Modified: lib/rest-adaptor.js (+3 -2) =================================================================== --- lib/rest-adaptor.js 2013-01-21 14:22:09 +0900 (5f7f6dc) +++ lib/rest-adaptor.js 2013-01-21 14:23:45 +0900 (aef68b8) @@ -1,4 +1,3 @@ -var Connection = require('./backend-adaptor').Connection; var restRequestBuilders = require('./rest-request-builder'); function createHandler(type, @@ -20,7 +19,9 @@ exports.createHandler = createHandler; exports.registerHandlers = function(application, params) { params = params || {}; - var connection = params.connection || new Connection(params); + var connection = params.connection; + if (!connection) + throw new Error('Connection to the backend is required!'); var prefix = params.prefix || ''; prefix = prefix.replace(/\/$/, ''); Modified: lib/socket-adaptor.js (+2 -2) =================================================================== --- lib/socket-adaptor.js 2013-01-21 14:22:09 +0900 (02a1e71) +++ lib/socket-adaptor.js 2013-01-21 14:23:45 +0900 (d70306c) @@ -1,4 +1,3 @@ -var Connection = require('./backend-adaptor').Connection; var socketIo = require('socket.io'); function deepClone(base) { @@ -22,7 +21,8 @@ exports.buildResultData = buildResultData; exports.registerHandlers = function(application, server, params) { params = params || {}; - var connection = params.connection || new Connection(params); + if (!connection) + throw new Error('Connection to the backend is required!'); function createRequestHandler(command, socket) { return (function(data) { -------------- next part -------------- HTML����������������������������... 다운로드