Skip to content

Commit

Permalink
Adds some helpful logs around user session expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1g5 committed Aug 1, 2024
1 parent 2aaaff2 commit b15d99c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/src/org/commcare/services/CommCareSessionService.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,14 @@ private void timeToExpireSession() {
// timeout then wrap-up the process.
if (logoutStartedAt != -1 &&
currentTime > (logoutStartedAt + LOGOUT_TIMEOUT)) {
Logger.log(LogTypes.TYPE_USER,
"Crossed threshold to save form session state during scheduled session expiration. Passed " + (
currentTime - logoutStartedAt) + "ms");
// Try and grab the logout lock, aborting if synchronization is in
// progress.
if (!CommCareSessionService.sessionAliveLock.tryLock()) {
Logger.log(LogTypes.TYPE_USER,
"Unabled to get session lock during scheduled session expiration");
return;
}
try {
Expand All @@ -371,6 +376,8 @@ private void timeToExpireSession() {
// Try and grab the logout lock, aborting if synchronization is in
// progress.
if (!CommCareSessionService.sessionAliveLock.tryLock()) {
Logger.log(LogTypes.TYPE_USER,
"Unabled to get session lock during scheduled session expiration");
return;
}

Expand Down

0 comments on commit b15d99c

Please sign in to comment.