🎨 Data repo support for purging unreferenced indexes and objects https://github.com/siyuan-note/siyuan/issues/8054

This commit is contained in:
Liang Ding 2023-04-20 18:54:24 +08:00
parent 71110aeead
commit 38ed2a3300
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
12 changed files with 116 additions and 9 deletions

View file

@ -349,3 +349,15 @@ func resetRepo(c *gin.Context) {
return
}
}
func purgeRepo(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
if err := model.PurgeRepo(); nil != err {
ret.Code = -1
ret.Msg = fmt.Sprintf(model.Conf.Language(201), err.Error())
ret.Data = map[string]interface{}{"closeTimeout": 5000}
return
}
}