1、Fix "Scan Disk" user_uuid error that causes WebDAV unable to display scan list.

2、Fix the problem of abnormality when scanning non-existent folders.
This commit is contained in:
MuGu
2023-09-01 18:46:20 +08:00
parent f4965c8256
commit 9820a1e1f3
2 changed files with 8 additions and 6 deletions
+4 -3
View File
@@ -518,9 +518,10 @@ func (this *MatterDao) Delete(matter *Matter) {
//delete from db.
db := core.CONTEXT.GetDB().Delete(&matter)
this.PanicError(db.Error)
//delete dir from disk.
util.DeleteEmptyDir(matter.AbsolutePath())
if util.PathExists(matter.AbsolutePath()) {
//delete dir from disk.
util.DeleteEmptyDir(matter.AbsolutePath())
}
} else {
+4 -3
View File
@@ -133,9 +133,10 @@ func (this *TaskService) doScanTask() {
this.logger.Info("scan spaceName = %s", space.Name)
//find admin as operator.
adminUser := this.userDao.FindAnAdmin()
this.matterService.DeleteByPhysics(request, adminUser, space)
this.matterService.ScanPhysics(request, adminUser, space)
// adminUser := this.userDao.FindAnAdmin()
user := this.userDao.FindByUuid(space.UserUuid)
this.matterService.DeleteByPhysics(request, user, space)
this.matterService.ScanPhysics(request, user, space)
})