Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

27
LINES

< > BotCompany Repo | #1010663 // Auto-Restart Program On Server Change [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (3320L/23K).

!7

sS progID = #1009961;
static double interval = 1;

p {
  repeat with sleep interval {
    checkProgram(progID);
  }
}

svoid checkProgram(S progID) ctex {
  if (!isProgramRunning(progID)) { print(progID + " not running"); ret; }
  
  S newMD5 = getServerTranspilationMD5(progID);
  if (!isMD5(newMD5)) { print("No server transpilation"); ret; }
  print("Server MD5 for " + progID + ": " + newMD5);
  
  //S localMD5 = md5(DiskSnippetCache_get(psI(progID)));
  S localMD5 = md5(loadCachedTranspilation(progID));
  print("Local MD5: " + localMD5);

  if (neq(localMD5, newMD5)) {
    restartProgram(progID);
    sleepSeconds(10);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1010663
Snippet name: Auto-Restart Program On Server Change [OK]
Eternal ID of this version: #1010663/14
Text MD5: 8a06023d7293bd4373875155ab10e1ec
Transpilation MD5: a537b1c48db455a030cc7468c49eed7b
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-24 14:39:17
Source code size: 663 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 532 / 1157
Version history: 13 change(s)
Referenced in: #1010683 - autoRestart - auto-restart program on server change