Commit 4b487324 authored by Félix Hamel's avatar Félix Hamel

1.7.25-beta9

Better compatibility with Hapi v16
- Removed MongoDB Cache (useless)
parent c3484634
......@@ -248,26 +248,7 @@ CMBF.prototype.launch = P.method(function(pluginOpts) {
var _this = this;
this.log.info("Initiating the CMBF launch process");
var caches = [
{
name: "memoryCache",
engine: require("catbox-memory"),
allowMixedContent: true
}
];
if (process.env.CACHE_MONGODB_HOST) {
caches.push({
name: "mongoCache",
engine: require("catbox-mongodb"),
host: process.env.CACHE_MONGODB_HOST,
port: process.env.CACHE_MONGODB_PORT,
username: process.env.CACHE_MONGODB_USERNAME,
password: process.env.CACHE_MONGODB_PASSWORD,
poolSize: process.env.CACHE_MONGODB_POOLSIZE,
partition: "cache"
});
}
var caches = [];
if (process.env.CACHE_REDIS_HOST) {
caches.push({
......@@ -283,11 +264,13 @@ CMBF.prototype.launch = P.method(function(pluginOpts) {
// Initializing the Hapi server
var serverOpts = {
cache: caches,
debug: {
request: ["error", "warning"]
}
};
if (_.size(caches) > 0) {
serverOpts.cache = caches;
}
// Configure the server
return _this.callHook("configure-server", serverOpts).then(function(opts) {
......@@ -603,16 +586,14 @@ CMBF.prototype.launch = P.method(function(pluginOpts) {
return _this.callHook("before-server-start", { server: server });
})
// Launch the server
.then(function() {
_this.log.debug("Starting the server");
return server.start()
.then(function() {
_this.log.info("Server started !");
return _this.callHook("server-started", { server: server });
})
.catch((error) => {
_this.log.fatal("ERRRROR", error);
});
.then(async function() {
_this.log.info("Starting the server");
await server.start();
_this.log.info("Server started !");
return _this.callHook("server-started", { server: server });
})
// Launch is complete
.then(function() {
......
{
"name": "cmbf-core",
"version": "1.7.25-beta8",
"version": "1.7.25-beta9",
"description": "Covistra Mobile-Backend Framework Core Module",
"main": "index.js",
"scripts": {
......@@ -17,9 +17,8 @@
"boom": "^7.3.0",
"bunyan": "^1.8.12",
"bunyan-format": "^0.2.1",
"catbox-memory": "^4.0.1",
"catbox-mongodb": "^4.2.1",
"catbox-redis": "^4.2.4",
"catbox-memory": "^2.0.4",
"catbox-redis": "^3.1.1",
"chairo": "^3.0.0",
"good": "^7.3.0",
"good-bunyan": "^2.0.1",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment