This commit is contained in:
@@ -8,12 +8,11 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/modules/graceful"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/storage"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modules/graceful"
|
||||
"gitea.dev/modules/log"
|
||||
"gitea.dev/modules/storage"
|
||||
"gitea.dev/modules/timeutil"
|
||||
)
|
||||
|
||||
// NoticeType describes the notice type
|
||||
@@ -60,18 +59,6 @@ func CreateRepositoryNotice(desc string, args ...any) error {
|
||||
return CreateNotice(graceful.GetManager().ShutdownContext(), NoticeRepository, desc, args...)
|
||||
}
|
||||
|
||||
// RemoveAllWithNotice removes all directories in given path and
|
||||
// creates a system notice when error occurs.
|
||||
func RemoveAllWithNotice(ctx context.Context, title, path string) {
|
||||
if err := util.RemoveAll(path); err != nil {
|
||||
desc := fmt.Sprintf("%s [%s]: %v", title, path, err)
|
||||
log.Warn(title+" [%s]: %v", path, err)
|
||||
if err = CreateNotice(graceful.GetManager().ShutdownContext(), NoticeRepository, desc); err != nil {
|
||||
log.Error("CreateRepositoryNotice: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// RemoveStorageWithNotice removes a file from the storage and
|
||||
// creates a system notice when error occurs.
|
||||
func RemoveStorageWithNotice(ctx context.Context, bucket storage.ObjectStorage, title, path string) {
|
||||
|
||||
Reference in New Issue
Block a user