From ac81280061c65cf90bcfd103e38361dd95ef54bb Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 05 Apr 2025 17:35:05 +0800 Subject: [PATCH] HTTP: Remove GC --- http_handle_gc.go | 19 ------------------- http_server.go | 3 --- templates/index.tmpl | 4 ---- diff --git a/http_handle_gc.go b/http_handle_gc.go deleted file mode 100644 index 83d2e06a782a7ca178e3e2a5570e9e068011ba59..0000000000000000000000000000000000000000 --- a/http_handle_gc.go +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-only -// SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu - -package main - -import ( - "net/http" - "runtime" -) - -// httpHandleGC handles an HTTP request by calling the garbage collector and -// redirecting the user back to the home page. -// -// TODO: This should probably be removed or hidden behind an administrator's -// control panel, in the future. -func httpHandleGC(writer http.ResponseWriter, request *http.Request, _ map[string]any) { - runtime.GC() - http.Redirect(writer, request, "/", http.StatusSeeOther) -} diff --git a/http_server.go b/http_server.go index 4b6e0ab97f4e1fa8cc571d7e4479b6199f1710fe..7268ad0ade8cacbefb158d553660bf5b9148eeac 100644 --- a/http_server.go +++ b/http_server.go @@ -104,9 +104,6 @@ return case "users": httpHandleUsers(writer, request, params) return - case "gc": - httpHandleGC(writer, request, params) - return default: errorPage404(writer, params) return diff --git a/templates/index.tmpl b/templates/index.tmpl index 3d8fd1997e306d362862c434f727a3581d526094..ff7c1275e4da6e31d51654ebfef7d8c3bd62f463 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -52,10 +52,6 @@ SSH fingerprint {{- .global.server_public_key_fingerprint -}} - - Memory usage - Allocated {{ .mem }} Run the garbage collector - -- 2.48.1