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

27
LINES

< > BotCompany Repo | #1010356 // dbOpt - start persistence only if we're the first one; otherwise load only

JavaX fragment (include)

1  
please include function conceptsAndBot.
2  
3  
static bool dbOpt_noSave;
4  
5  
static bool dbOpt() {
6  
  ret dbOpt(null);
7  
}
8  
9  
static bool dbOpt(Int autoSaveInterval) {
10  
  if (conceptsAndBot_running) ret !dbOpt_noSave;
11  
  conceptsAndBot_running = true;
12  
  
13  
  if (hasBot(dbBotStandardName())) {
14  
    mainConcepts.dontSave = true; // SAFETY
15  
    dbOpt_noSave = true;
16  
    mainConcepts.load();
17  
    false;
18  
  } else {
19  
    dbOpt_noSave = false;
20  
    if (autoSaveInterval != null)
21  
      loadAndAutoSaveConcepts(autoSaveInterval);
22  
    else
23  
      loadAndAutoSaveConcepts();
24  
    dbBot();
25  
    true;
26  
  }
27  
}

Author comment

Began life as a copy of #1005952

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: #1010356
Snippet name: dbOpt - start persistence only if we're the first one; otherwise load only
Eternal ID of this version: #1010356/4
Text MD5: 39d651f2cd999ef28f94488164c99be3
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-12 16:04:07
Source code size: 597 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 351 / 390
Version history: 3 change(s)
Referenced in: [show references]