From 2a057bac1efb7c6175331ee4fd72a15c0df01422 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 9 Mar 2025 16:25:28 +0800 Subject: gc: Add a garbage collection button --- http_handle_gc.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 http_handle_gc.go (limited to 'http_handle_gc.go') diff --git a/http_handle_gc.go b/http_handle_gc.go new file mode 100644 index 0000000..3f7717c --- /dev/null +++ b/http_handle_gc.go @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: AGPL-3.0-only +// SPDX-FileContributor: Runxi Yu + +package main + +import ( + "net/http" + "runtime" +) + +func handle_gc(w http.ResponseWriter, r *http.Request, params map[string]any) { + runtime.GC() + http.Redirect(w, r, "/", http.StatusSeeOther) +} -- cgit v1.2.3