diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 17:35:05 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 17:35:05 +0800 |
commit | ac81280061c65cf90bcfd103e38361dd95ef54bb (patch) | |
tree | b127f6ee0943dd1ed17fae751b509811cf9ffd71 | |
parent | Refactor git2d comms to ./git2c (diff) | |
download | forge-ac81280061c65cf90bcfd103e38361dd95ef54bb.tar.gz forge-ac81280061c65cf90bcfd103e38361dd95ef54bb.tar.zst forge-ac81280061c65cf90bcfd103e38361dd95ef54bb.zip |
HTTP: Remove GC
-rw-r--r-- | http_handle_gc.go | 19 | ||||
-rw-r--r-- | http_server.go | 3 | ||||
-rw-r--r-- | templates/index.tmpl | 4 |
3 files changed, 0 insertions, 26 deletions
diff --git a/http_handle_gc.go b/http_handle_gc.go deleted file mode 100644 index 83d2e06..0000000 --- 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 <https://runxiyu.org> - -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 4b6e0ab..7268ad0 100644 --- a/http_server.go +++ b/http_server.go @@ -104,9 +104,6 @@ func (router *forgeHTTPRouter) ServeHTTP(writer http.ResponseWriter, request *ht 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 3d8fd19..ff7c127 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -52,10 +52,6 @@ <th scope="row">SSH fingerprint</th> <td><code>{{- .global.server_public_key_fingerprint -}}</code></td> </tr> - <tr> - <th scope="row">Memory usage</th> - <td>Allocated {{ .mem }} <a href="/-/gc/" class="btn btn-danger">Run the garbage collector</a></td> - </tr> </tbody> </table> </div> |