Skip to content

Commit fbee331

Browse files
Renamed NGSession.shouldTerminate() to .shouldReap()
1 parent 04572ed commit fbee331

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

ng-appserver/src/main/java/ng/appserver/NGApplication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ private void addSessionCookieToResponse( final NGRequest request, final NGRespon
439439
final NGSession session = request.existingSession();
440440

441441
if( session != null ) {
442-
if( session.shouldTerminate() ) {
442+
if( session.shouldReap() ) {
443443
// If the session is terminating, delete the client side session cookie
444444
response.addCookie( createSessionResetCookie() );
445445
// CHECKME: This might be a better location to ask session storage to dispose of a terminated session.
@@ -457,7 +457,7 @@ private void addSessionCookieToResponse( final NGRequest request, final NGRespon
457457
private void touchSessionIfPresentAndNotTerminating( final NGRequest request ) {
458458
final NGSession session = request.existingSession();
459459

460-
if( session != null && !session.shouldTerminate() ) {
460+
if( session != null && !session.shouldReap() ) {
461461
session.touch();
462462
}
463463
}

ng-appserver/src/main/java/ng/appserver/NGServerSessionStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void run() {
3535

3636
// CHECKME: Iterating through every session every five seconds itsn't exactly efficient. We might want to look into some alternative methods // Hugi 2023-01-21
3737
for( final NGSession session : sessions() ) {
38-
if( session.shouldTerminate() ) {
38+
if( session.shouldReap() ) {
3939
_sessions.remove( session.sessionID() );
4040
logger.debug( "Terminated session with ID {}", session.sessionID() );
4141
}

ng-appserver/src/main/java/ng/appserver/NGSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private boolean isTimedOut() {
122122
/**
123123
* @return true if this session should be harvested/terminated by session storage. This essentially means the session has timed out, or has been manually terminated
124124
*/
125-
public boolean shouldTerminate() {
125+
public boolean shouldReap() {
126126
return _manuallyTerminated || isTimedOut();
127127
}
128128

0 commit comments

Comments
 (0)