mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
moving db.close into the parent module
This commit is contained in:
@@ -77,6 +77,10 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.close = function(callback) {
|
||||||
|
db.close(callback);
|
||||||
|
};
|
||||||
|
|
||||||
var helpers = {};
|
var helpers = {};
|
||||||
|
|
||||||
helpers.iterator = function(fn, keys, value, callback) {
|
helpers.iterator = function(fn, keys, value, callback) {
|
||||||
|
|||||||
@@ -6,10 +6,6 @@ var nconf = require('nconf'),
|
|||||||
module.exports = function(db, module) {
|
module.exports = function(db, module) {
|
||||||
var helpers = module.helpers.level;
|
var helpers = module.helpers.level;
|
||||||
|
|
||||||
module.close = function(callback) {
|
|
||||||
db.close(callback);
|
|
||||||
};
|
|
||||||
|
|
||||||
module.searchIndex = function(key, content, id) {
|
module.searchIndex = function(key, content, id) {
|
||||||
// o.O
|
// o.O
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -105,6 +105,11 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.close = function() {
|
||||||
|
db.close();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
var helpers = {};
|
var helpers = {};
|
||||||
helpers.findItem = function(data, key) {
|
helpers.findItem = function(data, key) {
|
||||||
if(!data) {
|
if(!data) {
|
||||||
|
|||||||
@@ -5,9 +5,6 @@ var winston = require('winston');
|
|||||||
module.exports = function(db, module) {
|
module.exports = function(db, module) {
|
||||||
var helpers = module.helpers.mongo;
|
var helpers = module.helpers.mongo;
|
||||||
|
|
||||||
module.close = function() {
|
|
||||||
db.close();
|
|
||||||
};
|
|
||||||
|
|
||||||
module.searchIndex = function(key, content, id) {
|
module.searchIndex = function(key, content, id) {
|
||||||
var data = {
|
var data = {
|
||||||
|
|||||||
@@ -101,5 +101,10 @@
|
|||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.close = function() {
|
||||||
|
redisClient.quit();
|
||||||
|
};
|
||||||
|
|
||||||
}(exports));
|
}(exports));
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
module.exports = function(redisClient, module) {
|
module.exports = function(redisClient, module) {
|
||||||
module.close = function() {
|
|
||||||
redisClient.quit();
|
|
||||||
};
|
|
||||||
|
|
||||||
module.searchIndex = function(key, content, id) {
|
module.searchIndex = function(key, content, id) {
|
||||||
if (key === 'post') {
|
if (key === 'post') {
|
||||||
module.postSearch.index(content, id);
|
module.postSearch.index(content, id);
|
||||||
|
|||||||
Reference in New Issue
Block a user