Fix the user_uuid error in scanning disk local space.

This commit is contained in:
MuGu
2023-09-02 17:17:26 +08:00
parent 9820a1e1f3
commit 05737663a2
+5 -8
View File
@@ -132,8 +132,7 @@ func (this *TaskService) doScanTask() {
this.logger.Info("scan spaceName = %s", space.Name)
//find admin as operator.
// adminUser := this.userDao.FindAnAdmin()
//find user by space
user := this.userDao.FindByUuid(space.UserUuid)
this.matterService.DeleteByPhysics(request, user, space)
this.matterService.ScanPhysics(request, user, space)
@@ -143,9 +142,6 @@ func (this *TaskService) doScanTask() {
})
} else if scanConfig.Scope == SCAN_SCOPE_CUSTOM {
//scan custom user's folder.
//find admin as operator.
adminUser := this.userDao.FindAnAdmin()
for _, spaceName := range scanConfig.SpaceNames {
space := this.spaceDao.FindByName(spaceName)
@@ -155,9 +151,10 @@ func (this *TaskService) doScanTask() {
this.logger.Info("scan custom user folder. spaceName = %s", spaceName)
core.RunWithRecovery(func() {
this.matterService.DeleteByPhysics(request, adminUser, space)
this.matterService.ScanPhysics(request, adminUser, space)
//find user by space
user := this.userDao.FindByUuid(space.UserUuid)
this.matterService.DeleteByPhysics(request, user, space)
this.matterService.ScanPhysics(request, user, space)
})