From 82e672f9cdecc8f73a2a2883463252187b9888c5 Mon Sep 17 00:00:00 2001 From: Menci Date: Sun, 9 Dec 2018 23:09:44 +0800 Subject: [PATCH] Allow load by require() and don't connect RMQ --- app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 0624e54..7af1688 100644 --- a/app.js +++ b/app.js @@ -67,7 +67,9 @@ global.syzoj = { })()); await this.connectDatabase(); - await this.lib('judger').connect(); + if (!module.parent) { + await this.lib('judger').connect(); + } this.loadModules(); }, async connectDatabase() {