Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(perf) don't create session if it is not required (#30322)
This pull request includes changes to improve session handling in the `CurrentVariantWebInterceptor` and `VariantWebAPIImpl` classes. The main focus is on ensuring sessions are only created when necessary, which can help optimize resource usage and performance. Session handling improvements: * [`dotCMS/src/main/java/com/dotcms/variant/business/web/CurrentVariantWebInterceptor.java`](diffhunk://#diff-65fdb30fd885a08035709f661b6cd0e1e4f4354bde74a4f3e1f6464e765d0731L59-R59): Modified `getSession` to avoid creating a new session if one does not already exist by passing `false` to `getSession`. * [`dotCMS/src/main/java/com/dotcms/variant/business/web/VariantWebAPIImpl.java`](diffhunk://#diff-c67db85ad5a8303546f73462e9074d4cf3f669295e99d9ca050c4bd8ce25e7f2L69-R78): Renamed `setSessionAttribute` to `setSessionAttributeIfNeeded` and updated the method to conditionally create a session based on the `currentVariantName`.
- Loading branch information