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

34
LINES

< > BotCompany Repo | #1005952 // conceptsAndBot

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (20105L) is out of date.

volatile sbool conceptsAndBot_running;
sbool conceptsAndBot_thinOnStart = true;

static void conceptsAndBot() {
  conceptsAndBot(null);
}

static void conceptsAndBot(Int autoSaveInterval) {
  if (conceptsAndBot_running) ret;
  conceptsAndBot_running = true;
  
  Concepts cc = db_mainConcepts();
  cc.programID = getDBProgramID();
  
  try {
    if (cc.useFileLock) {
      if (!cc.fileLock().tryToLock()) {
        ensureDBNotRunning(dbBotStandardName());
        cc.fileLock().forceLock();
      }
    } else
      ensureDBNotRunning(dbBotStandardName());
  } on fail e {
    printStackTrace(e);
    cc.dontSave = true; // SAFETY
  }
  
  cc.persist(autoSaveInterval);
  dbBot(false);
  
  if (conceptsAndBot_thinOnStart) pcall {
    thinAProgramsBackups(getDBProgramID(), true);
  }
}

Author comment

Began life as a copy of #1005329

download  show line numbers  debug dex  old transpilations   

Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, qsqiayxyrbia, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney

No comments. add comment

Snippet ID: #1005952
Snippet name: conceptsAndBot
Eternal ID of this version: #1005952/14
Text MD5: 7faaa3e3319fcf1e5df42bd63bdf58b3
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-12 23:55:38
Source code size: 820 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 784 / 917
Version history: 13 change(s)
Referenced in: [show references]