Skip to content

Commit

Permalink
fix: Delete Useless Session Listeners - MEED-7171 - Meeds-io/meeds#2249
Browse files Browse the repository at this point in the history
… (#1032)

Prior to this change, some session listeners was added while the
behavior isn't used anymore for notes draft management. This fix will
cleanup useless behavior which relies on session and reduce CPU and
memory consumption.
  • Loading branch information
boubaker authored Jul 9, 2024
1 parent c06a5a9 commit 65e83ed
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 219 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions notes-service/src/main/java/org/exoplatform/wiki/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,26 +298,6 @@ public static String getPermanlink(WikiPageParams params, boolean hasDowmainUrl)
return fillPortalName(sb.toString());
}

public static String getPageNameForAddingPage() {
return Utils.getPageNameForAddingPage(null);
}

public static String getPageNameForAddingPage(String sessionId) {
if(sessionId == null || sessionId.isEmpty()) {
sessionId = StringUtils.EMPTY;
PortalRequestContext portalRequestContext = Util.getPortalRequestContext();
if(portalRequestContext != null) {
HttpServletRequest request = portalRequestContext.getRequest();
if(request != null && request.getSession(false) != null) {
sessionId = request.getSession(false).getId();
}
}

}
String username = Utils.getCurrentUser();
return username + SPLIT_TEXT_OF_DRAFT_FOR_NEW_PAGE + sessionId;
}

private static String getDomainUrl() {
PortalRequestContext portalRequestContext = Util.getPortalRequestContext();
StringBuilder domainUrl = new StringBuilder();
Expand Down
25 changes: 0 additions & 25 deletions notes-service/src/main/resources/conf/portal/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">

<component>
<key>org.exoplatform.wiki.service.impl.SessionManager</key>
<type>org.exoplatform.wiki.service.impl.SessionManager</type>
</component>

<component>
<type>io.meeds.notes.service.NotePageViewService</type>
Expand Down Expand Up @@ -59,10 +54,6 @@
</properties-param>
</init-params>
</component>
<component>
<key>org.exoplatform.wiki.service.impl.SessionManager</key>
<type>org.exoplatform.wiki.service.impl.SessionManager</type>
</component>

<component>
<key>org.exoplatform.wiki.service.NoteService</key>
Expand Down Expand Up @@ -239,22 +230,6 @@
</component-plugin>
</external-component-plugins>

<external-component-plugins>
<target-component>org.exoplatform.services.listener.ListenerService</target-component>
<component-plugin>
<name>org.exoplatform.web.GenericHttpListener.sessionCreated</name>
<set-method>addListener</set-method>
<type>org.exoplatform.wiki.service.impl.SessionCreatedListener</type>
<description>description</description>
</component-plugin>
<component-plugin>
<name>org.exoplatform.web.GenericHttpListener.sessionDestroyed</name>
<set-method>addListener</set-method>
<type>org.exoplatform.wiki.service.impl.SessionDestroyedListener</type>
<description>description</description>
</component-plugin>
</external-component-plugins>

<external-component-plugins>
<target-component>org.exoplatform.services.listener.ListenerService</target-component>
<component-plugin>
Expand Down

0 comments on commit 65e83ed

Please sign in to comment.