diff --git a/js/server/arango-dfdb.js b/js/server/arango-dfdb.js index 828d9f8c80..888e584a0b 100644 --- a/js/server/arango-dfdb.js +++ b/js/server/arango-dfdb.js @@ -33,24 +33,25 @@ var fs = require("fs"); var printf = internal.printf; - //////////////////////////////////////////////////////////////////////////////// /// @brief unload a collection //////////////////////////////////////////////////////////////////////////////// function UnloadCollection (collection) { - var last = Math.round(internal.time()); + var tries = 0; // unload collection if not yet unloaded (2) & not corrupted (0) while (collection.status() !== 2 && collection.status() !== 0) { collection.unload(); - var next = Math.round(internal.time()); - - if (next !== last) { - printf("Trying to unload collection '%s'\n", collection.name()); - last = next; + if (++tries >= 20) { + break; } + if (tries == 1) { + printf("Trying to unload collection '%s', current status: %s\n", collection.name(), collection.status()); + } + + internal.wait(1, true); } } diff --git a/js/server/server.js b/js/server/server.js index 5c4e9f362d..48fe25f3ee 100644 --- a/js/server/server.js +++ b/js/server/server.js @@ -46,8 +46,16 @@ require('@arangodb/statistics').startup(); } + // check if --server.rest-server is disabled + // in this case we do not (and should not) initialize and start Foxx + var options = internal.options(); + var restServer = true; + if (options.hasOwnProperty("server.rest-server")) { + restServer = options["server.rest-server"]; + } + // load all foxxes - if (internal.threadNumber === 0) { + if (internal.threadNumber === 0 && restServer) { internal.loadStartup('server/bootstrap/foxxes.js').foxxes(); } @@ -55,7 +63,9 @@ internal.loadStartup('server/bootstrap/autoload.js').startup(); // reload routing information - internal.loadStartup('server/bootstrap/routing.js').startup(); + if (restServer) { + internal.loadStartup('server/bootstrap/routing.js').startup(); + } // start the queue manager once if (internal.threadNumber === 0) {