From 075ee015abf1a7c15dcdb0fdf21bc392246e99ee Mon Sep 17 00:00:00 2001
From: mcmlxxix <>
Date: Wed, 8 Aug 2012 23:13:11 +0000
Subject: [PATCH] reload json db instance when reloading a module

---
 exec/json-service.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/exec/json-service.js b/exec/json-service.js
index 9c903ec237..74d9d42f6e 100644
--- a/exec/json-service.js
+++ b/exec/json-service.js
@@ -482,7 +482,7 @@ engine = new (function() {
 		this.name = name;
 		this.dir = dir;
 		this.queue = undefined;
-		this.db = new JSONdb(this.dir+this.name+".json");
+		this.db;
 		this.init = function() {
 			/* load module service files */
 			if(file_exists(this.dir + "service.js")) {
@@ -492,6 +492,7 @@ engine = new (function() {
 					log(LOG_ERROR,"error loading module: " + this.name);
 				}
 			}
+			this.db = new JSONdb(this.dir+this.name+".json");
 		}
 		this.init();
 	}
-- 
GitLab