1
0
Fork 0

do not complain about missing dispatcher when server is started with `--no-server` option

This commit is contained in:
Jan Steemann 2014-08-30 01:34:10 +02:00
parent c90777738d
commit 6844433558
1 changed files with 6 additions and 2 deletions

View File

@ -41,6 +41,7 @@
#include "Basics/WriteLocker.h"
#include "BasicsC/logging.h"
#include "BasicsC/tri-strings.h"
#include "Dispatcher/ApplicationDispatcher.h"
#include "Rest/HttpRequest.h"
#include "Scheduler/ApplicationScheduler.h"
#include "Scheduler/Scheduler.h"
@ -1191,7 +1192,7 @@ bool ApplicationV8::prepareV8Instance (const string& name, size_t i, bool useAct
V8Context* context = _contexts[name][i] = new V8Context();
if (context == 0) {
if (context == nullptr) {
LOG_FATAL_AND_EXIT("cannot initialize V8 context #%d", (int) i);
}
@ -1215,7 +1216,10 @@ bool ApplicationV8::prepareV8Instance (const string& name, size_t i, bool useAct
TRI_InitV8Queries(context->_context);
TRI_InitV8Cluster(context->_context);
TRI_InitV8Dispatcher(context->_context, _vocbase, _scheduler, _dispatcher, this);
if (_dispatcher->dispatcher() != nullptr) {
// don't initialise dispatcher if there is no scheduler (server started with --no-server option)
TRI_InitV8Dispatcher(context->_context, _vocbase, _scheduler, _dispatcher, this);
}
if (useActions) {
TRI_InitV8Actions(context->_context, _vocbase, this);