diff --git a/src/main.d b/src/main.d index f0fe6bc71..4a01e3b5a 100644 --- a/src/main.d +++ b/src/main.d @@ -899,10 +899,6 @@ void performStandardExitProcess(string scopeCaller) { // Who called this function log.vdebug("Running performStandardExitProcess due to: ", scopeCaller); - // Wait for all parallel jobs that depend on the database to complete - log.vdebug("Wait for all parallel jobs that depend on the database to complete"); - taskPool.finish(true); - // Shutdown the OneDrive API instance if (oneDriveApiInstance !is null) { log.vdebug("Shutdown OneDrive API instance"); diff --git a/src/onedrive.d b/src/onedrive.d index c81271c2f..828c54544 100644 --- a/src/onedrive.d +++ b/src/onedrive.d @@ -68,6 +68,7 @@ class OneDriveWebhook { // Cache instantiation flag in thread-local bool // Thread local private static bool instantiated_; + private RequestServer server; // Thread global private __gshared OneDriveWebhook instance_; @@ -107,10 +108,11 @@ class OneDriveWebhook { void stop() { if (this.started) { - RequestServer.stop(); + server.stop(); this.started = false; } log.log("Stopped webhook server"); + object.destroy(server); } // The static serve() is necessary because spawn() does not like instance methods @@ -128,7 +130,7 @@ class OneDriveWebhook { } private void serveImpl() { - auto server = new RequestServer(host, port); + server = RequestServer(host, port); server.serveEmbeddedHttp!handle(); }