diff --git a/code/rest/task_service.go b/code/rest/task_service.go index e9ca22d..da614b1 100644 --- a/code/rest/task_service.go +++ b/code/rest/task_service.go @@ -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) })