diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-09 16:25:28 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-09 16:26:46 +0800 |
commit | 2a057bac1efb7c6175331ee4fd72a15c0df01422 (patch) | |
tree | bd16cd1994791b136aaf615999eeddb5d39f45c0 /http_handle_gc.go | |
parent | *: Downgrade go-git from main to v5.14.0 (diff) | |
download | forge-2a057bac1efb7c6175331ee4fd72a15c0df01422.tar.gz forge-2a057bac1efb7c6175331ee4fd72a15c0df01422.tar.zst forge-2a057bac1efb7c6175331ee4fd72a15c0df01422.zip |
gc: Add a garbage collection button
Diffstat (limited to 'http_handle_gc.go')
-rw-r--r-- | http_handle_gc.go | 14 |
1 files changed, 14 insertions, 0 deletions
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 <https://runxiyu.org> + +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) +} |