mirror of
https://github.com/rls-moe/nyx
synced 2024-11-14 22:12:24 +00:00
22 lines
387 B
Go
22 lines
387 B
Go
package admin
|
|
|
|
import (
|
|
"github.com/tidwall/buntdb"
|
|
"go.rls.moe/nyx/http/errw"
|
|
"go.rls.moe/nyx/http/middle"
|
|
"net/http"
|
|
)
|
|
|
|
func handleCleanup(w http.ResponseWriter, r *http.Request) {
|
|
db := middle.GetDB(r)
|
|
err := db.Update(func(tx *buntdb.Tx) error {
|
|
/* Insert cleanup codes here */
|
|
return nil
|
|
})
|
|
err = db.Shrink()
|
|
if err != nil {
|
|
errw.ErrorWriter(err, w, r)
|
|
return
|
|
}
|
|
}
|