From cb5de72e13fc4fd91b0c420a8f2f6d409b53fce8 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Tue, 19 Apr 2022 16:37:45 +0000 Subject: [PATCH] db: Don't warn about clearing db when using in-memory db --- core/db.mjs | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/db.mjs b/core/db.mjs index 8ba0a3f..a92a27c 100644 --- a/core/db.mjs +++ b/core/db.mjs @@ -122,7 +122,9 @@ export default function GetDB(config, log, orgFilename = 'db.json') { return db.read() .then(function() { if (!isObject(db.data)) { - db.log.warn(`File ${fullpath} was empty or not a json object, clearing it.`) + if (fullpath !== 'in-memory') { + db.log.warn(`File ${fullpath} was empty or not a json object, clearing it.`) + } db.data = {} } defaults(db.data, { core: { version: 1 } }) diff --git a/package.json b/package.json index 20db506..23697b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "service-core", - "version": "3.0.0-beta.16", + "version": "3.0.0-beta.17", "description": "Core boiler plate code to install node server as windows service", "main": "index.mjs", "scripts": {