Add configurable tick interval (time between trades)
- Seed tick_interval_seconds setting (default 60s) - Expose tick_interval_seconds via GET/PATCH /api/settings - startScheduler reads the setting at start time; enforces 5s minimum - getSchedulerStatus returns intervalSeconds for the UI - Main page: "Every [__] s" input in idle bar — saves on blur, persists across restarts; running state displays "every Ns" next to symbol/action Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
39d7c5761c
commit
245a15666e
+4
-2
@@ -336,8 +336,9 @@ export function startScheduler(action: 'Buy' | 'Sell' | 'Random', symbol: string
|
||||
}
|
||||
};
|
||||
|
||||
state.intervalId = setInterval(tick, 60_000);
|
||||
console.log(`[scheduler] started — ${action} ${symbol} every 60s`);
|
||||
const intervalSecs = Math.max(5, parseInt(getSetting('tick_interval_seconds') ?? '60', 10));
|
||||
state.intervalId = setInterval(tick, intervalSecs * 1_000);
|
||||
console.log(`[scheduler] started — ${action} ${symbol} every ${intervalSecs}s`);
|
||||
}
|
||||
|
||||
export function stopScheduler() {
|
||||
@@ -357,5 +358,6 @@ export function getSchedulerStatus() {
|
||||
action: state.action,
|
||||
symbol: state.symbol,
|
||||
lastRun: state.lastRun,
|
||||
intervalSeconds: parseInt(getSetting('tick_interval_seconds') ?? '60', 10),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user