From 4f2ea38222847233b27efae7d8c259838d3b84c4 Mon Sep 17 00:00:00 2001 From: Andy Burke Date: Wed, 23 Jul 2025 17:00:15 -0700 Subject: [PATCH] fix: unlisten for interrupts earlier --- deno.json | 2 +- server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deno.json b/deno.json index b7eaace..314dec8 100644 --- a/deno.json +++ b/deno.json @@ -1,7 +1,7 @@ { "name": "@andyburke/serverus", "description": "A flexible HTTP server for mixed content. Throw static files, markdown, Typescript and (hopefully, eventually) more into a directory and serverus can serve it up a bit more like old-school CGI.", - "version": "0.9.4", + "version": "0.9.5", "license": "MIT", "exports": { ".": "./serverus.ts", diff --git a/server.ts b/server.ts index 3194e0b..a1ec040 100644 --- a/server.ts +++ b/server.ts @@ -196,11 +196,11 @@ export class SERVER { */ public async stop(): Promise { if (this.server) { - this.controller?.abort(); if (this.shutdown_binding) { Deno.removeSignalListener('SIGTERM', this.shutdown_binding); Deno.removeSignalListener('SIGINT', this.shutdown_binding); } + this.controller?.abort(); await this.server.shutdown(); }