Skip to content
Snippets Groups Projects
Commit eb860a18 authored by mcmlxxix's avatar mcmlxxix
Browse files

added module commands "readable", "readonly" and "save"

wrap background service loads in try/catch
parent 84f7f5f1
No related branches found
No related tags found
No related merge requests found
...@@ -337,6 +337,21 @@ engine = new (function() { ...@@ -337,6 +337,21 @@ engine = new (function() {
case "OPEN": case "OPEN":
module.online = true; module.online = true;
break; break;
case "READABLE":
if(module.db.settings.KEEP_READABLE)
module.db.settings.KEEP_READABLE = false;
else
module.db.settings.KEEP_READABLE = true;
break;
case "SAVE":
module.db.save();
break;
case "READONLY":
if(module.db.settings.READ_ONLY)
module.db.settings.READ_ONLY = false;
else
module.db.settings.READ_ONLY = true;
break;
default: default:
error(client,errors.UNKNOWN_FUNCTION,packet.func); error(client,errors.UNKNOWN_FUNCTION,packet.func);
break; break;
...@@ -356,7 +371,11 @@ engine = new (function() { ...@@ -356,7 +371,11 @@ engine = new (function() {
this.init = function() { this.init = function() {
/* load module service files */ /* load module service files */
if(file_exists(this.dir + "service.js")) { if(file_exists(this.dir + "service.js")) {
this.queue = load(true,this.dir + "service.js",this.dir); try {
this.queue = load(true,this.dir + "service.js",this.dir);
} catch(e) {
log(LOG_ERROR,"error loading module: " + name);
}
} }
} }
this.init(); this.init();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment