aboutsummaryrefslogtreecommitdiff
path: root/http_handle_gc.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-31 16:59:18 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-31 16:59:18 +0800
commit655b6b211ae6df0186abd740f248939f7ddeaec1 (patch)
treeec5cdbbc52222f62c8fbb0bcf2a1aa7a9f6eb8b6 /http_handle_gc.go
parentCorrect table headers in MR indices (diff)
downloadforge-655b6b211ae6df0186abd740f248939f7ddeaec1.tar.gz
forge-655b6b211ae6df0186abd740f248939f7ddeaec1.tar.zst
forge-655b6b211ae6df0186abd740f248939f7ddeaec1.zip
Add descriptive comments to most Go functions
Diffstat (limited to 'http_handle_gc.go')
-rw-r--r--http_handle_gc.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/http_handle_gc.go b/http_handle_gc.go
index 3322c77..83d2e06 100644
--- a/http_handle_gc.go
+++ b/http_handle_gc.go
@@ -8,6 +8,11 @@ import (
"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)