File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
common-module/src/main/java/com/bbebig/commonmodule/redis/domain
state-server/src/main/java/com/bbebig/stateserver/service Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public void deleteDevice(String sessionId) {
5757 calculateGlobalStatus ();
5858 }
5959
60- private void calculateGlobalStatus () {
60+ public void calculateGlobalStatus () {
6161 if (devices == null || devices .isEmpty () || actualStatus == PresenceType .OFFLINE ) {
6262 actualStatus = PresenceType .OFFLINE ;
6363 globalStatus = PresenceType .OFFLINE ;
Original file line number Diff line number Diff line change @@ -115,6 +115,8 @@ private MemberPresenceStatus handleConnectionEvent(ConnectionEventDto connection
115115 memberPresenceStatus .getDevices ().add (deviceInfo );
116116 }
117117
118+ memberPresenceStatus .calculateGlobalStatus ();
119+
118120 memberRedisRepositoryImpl .saveMemberPresenceStatus (connectionEventDto .getMemberId (), memberPresenceStatus );
119121
120122 return memberPresenceStatus ;
@@ -137,6 +139,7 @@ private MemberPresenceStatus handleDisconnectionEvent(ConnectionEventDto connect
137139 memberRedisRepositoryImpl .saveMemberPresenceStatus (connectionEventDto .getMemberId (), memberPresenceStatus );
138140 }
139141
142+ memberPresenceStatus .calculateGlobalStatus ();
140143 memberRedisRepositoryImpl .saveMemberPresenceStatus (connectionEventDto .getMemberId (), memberPresenceStatus );
141144 return memberPresenceStatus ;
142145 }
You can’t perform that action at this time.
0 commit comments