mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-11 04:19:26 -07:00
feat: add background stats server daemon lifecycle
Implement `subminer stats -b` to start a background stats daemon and `subminer stats -s` to stop it, with PID-based process lifecycle management, single-instance lock bypass for daemon mode, and automatic reuse of running daemon instances.
This commit is contained in:
@@ -157,6 +157,26 @@ test('hasExplicitCommand and shouldStartApp preserve command intent', () => {
|
||||
assert.equal(hasExplicitCommand(stats), true);
|
||||
assert.equal(shouldStartApp(stats), true);
|
||||
|
||||
const statsBackground = parseArgs(['--stats', '--stats-background']) as typeof stats & {
|
||||
statsBackground?: boolean;
|
||||
statsStop?: boolean;
|
||||
};
|
||||
assert.equal(statsBackground.stats, true);
|
||||
assert.equal(statsBackground.statsBackground, true);
|
||||
assert.equal(statsBackground.statsStop, false);
|
||||
assert.equal(hasExplicitCommand(statsBackground), true);
|
||||
assert.equal(shouldStartApp(statsBackground), true);
|
||||
|
||||
const statsStop = parseArgs(['--stats', '--stats-stop']) as typeof stats & {
|
||||
statsBackground?: boolean;
|
||||
statsStop?: boolean;
|
||||
};
|
||||
assert.equal(statsStop.stats, true);
|
||||
assert.equal(statsStop.statsStop, true);
|
||||
assert.equal(statsStop.statsBackground, false);
|
||||
assert.equal(hasExplicitCommand(statsStop), true);
|
||||
assert.equal(shouldStartApp(statsStop), true);
|
||||
|
||||
const statsLifetimeRebuild = parseArgs([
|
||||
'--stats',
|
||||
'--stats-cleanup',
|
||||
|
||||
Reference in New Issue
Block a user