장동신 장동신 2024-09-19
리포트 로직 수정
@3037dfaf8f61ca034821f07f098e1ca64e810076
src/main/java/com/munjaon/server/server/task/ReportServerTask.java
--- src/main/java/com/munjaon/server/server/task/ReportServerTask.java
+++ src/main/java/com/munjaon/server/server/task/ReportServerTask.java
@@ -123,6 +123,10 @@
                 recvInterest();
                 /* RUN Flag 체크 */
                 reloadRunFlag();
+                /* 쓰레드 완료 시점 체크 */
+                if (System.currentTimeMillis() - SEND_CYCLE_CHECK_TIME > ServerConfig.REPORT_EXEC_CYCLE_TIME) {
+                    break;
+                }
             }
         } catch (Exception e) {
             /* 세션 만료 여부 */
@@ -298,7 +302,7 @@
                 }
             } else if (size == 0) {
                 Thread.sleep(1);
-                if (System.currentTimeMillis() - reportUserDto.getLastTrafficTime() > ServerConfig.REPORT_EXEC_CYCLE_TIME) {
+                if (System.currentTimeMillis() - SEND_CYCLE_CHECK_TIME >= ServerConfig.REPORT_EXEC_CYCLE_TIME) {
                     this.isExpiredYn = true;
                     break;
                 }
@@ -338,7 +342,7 @@
     }
 
     private void sendInterest() throws Exception {
-        if (!reportUserDto.isLogin()) {
+        if (isPacketSendYn) {
             return;
         }
         if (reportUserDto.isAlive() == 2) {
@@ -362,10 +366,6 @@
                 SEND_CYCLE_CHECK_TIME = System.currentTimeMillis();
                 isPacketSendYn = true;
             }
-        }
-        /* 쓰레드 완료 시점 체크 */
-        if (System.currentTimeMillis() - SEND_CYCLE_CHECK_TIME > ServerConfig.REPORT_EXEC_CYCLE_TIME) {
-            this.isExpiredYn = true;
         }
     }
 
src/main/resources/local/application-local.yml
--- src/main/resources/local/application-local.yml
+++ src/main/resources/local/application-local.yml
@@ -17,7 +17,12 @@
   shutdown: graceful
 
 # ### 에이전트 설정 관련 ####################################################################################
+#agent:
+#  root-path: C:/apps/agent_server
+#  server-property-file: C:/apps/agent_server/config/server.properties
+#  db-name: mjon_agent_back
+
 agent:
-  root-path: C:/apps/agent_server
-  server-property-file: C:/apps/agent_server/config/server.properties
+  root-path: /Users/jangdongsin/DevDocs/apps/itn/agent_server
+  server-property-file: /Users/jangdongsin/DevDocs/apps/itn/agent_server/config/server.properties
   db-name: mjon_agent_back
(No newline at end of file)
Add a comment
List