fix: updated the code to fetch all workspaces without the user session context (#39787)

This commit is contained in:
Nilansh Bansal 2025-03-18 20:44:16 +05:30 committed by GitHub
parent 9a48da4436
commit 80eefe7825
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 2 deletions

View File

@ -159,8 +159,8 @@ public class PluginServiceCEImpl extends BaseService<PluginRepository, Plugin, S
if (newWorkspacePlugins.isEmpty()) {
return Flux.empty();
}
return workspaceService.getAll().flatMap(workspace -> {
// used retrieveAll() as it does not need user session context
return workspaceService.retrieveAll().flatMap(workspace -> {
// Only perform a DB op if plugins associated to this org have changed
if (workspace.getPlugins().containsAll(newWorkspacePlugins)) {
return Mono.just(workspace);

View File

@ -43,4 +43,6 @@ public interface WorkspaceServiceCE extends CrudService<Workspace, String> {
Mono<Workspace> archiveById(String s);
Mono<String> getDefaultEnvironmentId(String workspaceId, AclPermission aclPermission);
Flux<Workspace> retrieveAll();
}

View File

@ -618,4 +618,9 @@ public class WorkspaceServiceCEImpl extends BaseService<WorkspaceRepository, Wor
public Flux<Workspace> getAll(AclPermission permission) {
return repository.findAll(permission);
}
@Override
public Flux<Workspace> retrieveAll() {
return repository.retrieveAll();
}
}