fix dbname
This commit is contained in:
parent
efc10cab3b
commit
cf5e734618
|
@ -429,6 +429,9 @@ module.exports.create = function (opts, verbs, mySocket) {
|
|||
}
|
||||
};
|
||||
|
||||
if (opts.init) {
|
||||
return db.init(opts);
|
||||
}
|
||||
return db;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "sqlite3-cluster",
|
||||
"version": "1.1.2",
|
||||
"version": "2.0.0",
|
||||
"description": "A wrapper to enable the use of sqlite3 with node cluster via a socket server (i.e. for Raspberry Pi 2).",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -84,7 +84,7 @@ function createApp(servers, options) {
|
|||
|
||||
switch(cmd.type) {
|
||||
case 'init':
|
||||
console.log('[S] init', cmd);
|
||||
//console.log('[S] init', cmd);
|
||||
db[cmd.func].apply(db, cmd.args).then(function () {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
var myself;
|
||||
|
|
|
@ -20,7 +20,6 @@ function create(opts, verbs) {
|
|||
var PromiseA = verbs.Promise || require('bluebird');
|
||||
var dbname = "";
|
||||
|
||||
dbname += (opts.dirname || '');
|
||||
dbname += (opts.prefix || '');
|
||||
if (opts.subtenant) {
|
||||
dbname += opts.subtenant + '.';
|
||||
|
@ -31,6 +30,7 @@ function create(opts, verbs) {
|
|||
dbname += (opts.dbname || '');
|
||||
dbname += (opts.suffix || '');
|
||||
dbname += (opts.ext || '');
|
||||
dbname = require('path').resolve(opts.dirname || '', dbname);
|
||||
|
||||
function initDb(newOpts) {
|
||||
if (dbs[dbname].initPromise) {
|
||||
|
|
Loading…
Reference in New Issue