Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit 6fb8d42

Browse files
committed
Kelp GUI: adjust frontend timer intervals and add comments
1 parent 6e853bf commit 6fb8d42

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • gui/web/src/components/molecules/BotCard

gui/web/src/components/molecules/BotCard/BotCard.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ let defaultBotInfo = {
4545
"spread_pct": "?",
4646
}
4747

48-
const botStateIntervalMillis = 2000;
48+
// botStateIntervalMillis: it's inexpensive to call this since it only looks in-memory on the backend so
49+
// we can run it once every second
50+
const botStateIntervalMillis = 1000;
51+
// botInfoIntervalMillis: its expensive to run this frequently because it calls out to horizon which will
52+
// consume the rate limit, 5 seconds is fast enough since that's the ledger close time on SDEX
4953
const botInfoIntervalMillis = 5000;
50-
const botInfoTimeoutMillis = 3000; // should be less than interval
54+
// botInfoTimeoutMillis: should be less than botInfoIntervalMillis
55+
const botInfoTimeoutMillis = 3000;
5156

5257
class BotCard extends Component {
5358
constructor(props) {

0 commit comments

Comments
 (0)