Skip to content

Commit c7d55c3

Browse files
author
Ugo Plouviez
authored
Merge pull request #207 from iExecBlockchainComputing/logs
Add logs in ping
2 parents 064eaf9 + 285dd25 commit c7d55c3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/com/iexec/worker/PingService.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,20 @@ public void pingScheduler() {
2828
String sessionId = feignClient.ping();
2929
String currentSessionId = coreConfigurationService.getCoreSessionId();
3030
if (currentSessionId == null || currentSessionId.isEmpty()){
31+
log.info("First ping from the worker, setting the sessionId [coreSessionId:{}]", sessionId);
3132
coreConfigurationService.setCoreSessionId(sessionId);
3233
return;
3334
}
3435

36+
if(sessionId != null && sessionId.equals("")){
37+
log.warn("The worker cannot ping the core!");
38+
return;
39+
}
40+
3541
if (sessionId != null && !sessionId.equalsIgnoreCase(currentSessionId)){
3642
// need to reconnect to the core by restarting the worker
37-
log.warn("Scheduler seems to have restarted, the worker will restart now!");
43+
log.warn("Scheduler seems to have restarted [currentSessionId:{}, coreSessionId:{}]", currentSessionId, sessionId);
44+
log.warn("The worker will restart now!");
3845
restartService.restartApp();
3946
}
4047
}

0 commit comments

Comments
 (0)