1 | static long waitForBotStartUp_timeoutSeconds = 60; |
2 | |
3 | // returns address or fails |
4 | static S waitForBotStartUp(S botName) {
|
5 | for (int i = 0; i < waitForBotStartUp_timeoutSeconds; i++) {
|
6 | sleepSeconds(i == 0 ? 0 : 1); |
7 | S addr = getBotAddress(botName); |
8 | if (addr != null) |
9 | return addr; |
10 | } |
11 | throw fail("Bot not found: " + quote(botName));
|
12 | } |
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: | #1001366 |
| Snippet name: | waitForBotStartUp |
| Eternal ID of this version: | #1001366/1 |
| Text MD5: | 2f8831810180fe543f3e9ce5760af5d0 |
| Author: | stefan |
| Category: | |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2015-11-13 17:09:30 |
| Source code size: | 361 bytes / 12 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 948 / 2619 |
| Referenced in: | [show references] |