fix: Use non blocking SCAN command instead of blocking keys for redis… (#40878)
… pattern match ## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /test all ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/15468149296> > Commit: f7391b7e5d00964ba4c3354b89ee55d9d80af430 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=15468149296&attempt=2&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Thu, 05 Jun 2025 16:17:10 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Improved the way session data is retrieved from Redis for better performance and scalability. No visible changes to user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
e6cebfd3cc
commit
8f35929b19
|
|
@ -9,6 +9,7 @@ import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.data.redis.core.ReactiveRedisOperations;
|
import org.springframework.data.redis.core.ReactiveRedisOperations;
|
||||||
|
import org.springframework.data.redis.core.ScanOptions;
|
||||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
import org.springframework.security.core.context.ReactiveSecurityContextHolder;
|
import org.springframework.security.core.context.ReactiveSecurityContextHolder;
|
||||||
|
|
@ -105,7 +106,7 @@ public class SessionUserServiceCEImpl implements SessionUserServiceCE {
|
||||||
*/
|
*/
|
||||||
public Flux<Tuple2<String, User>> getSessionKeysWithUserSessions() {
|
public Flux<Tuple2<String, User>> getSessionKeysWithUserSessions() {
|
||||||
return redisOperations
|
return redisOperations
|
||||||
.keys(SPRING_SESSION_PATTERN)
|
.scan(ScanOptions.scanOptions().match(SPRING_SESSION_PATTERN).build())
|
||||||
.flatMap(key -> Mono.zip(
|
.flatMap(key -> Mono.zip(
|
||||||
Mono.just(key),
|
Mono.just(key),
|
||||||
// The values are maps, containing various pieces of session related information.
|
// The values are maps, containing various pieces of session related information.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user