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

18
LINES

< > BotCompany Repo | #1013957 // autoRestartModule - auto-restart hotwired module on server change (v1, broken)

JavaX fragment (include)

static void autoRestartModule(fS moduleVar, fS programID, final bool callMain) {
  doLater_daemon(5000, new Runnable {
    S localMD5;
    
    public void run() {
      S newMD5 = loadPageSilently("http://botcompany.de/1010693/raw?id=" + psI(programID));
      if (!isMD5(newMD5)) ret;
      if (localMD5 == null)
        localMD5 = md5(loadCachedTranspilation(programID));

      S localMD5 = autoRestart_localMD5();
      if (neq(localMD5, newMD5)) {
        S name = snippetWithTitle(programID);
        upgradeModuleVar(moduleVar, programID, callMain);
      }
    }
  });
}

Author comment

Began life as a copy of #1013937

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: #1013957
Snippet name: autoRestartModule - auto-restart hotwired module on server change (v1, broken)
Eternal ID of this version: #1013957/1
Text MD5: e49f907962e5a6841c0d26a86bd0ced0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-03-18 16:56:34
Source code size: 596 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 510 / 557
Referenced in: [show references]