mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-28 00:55:16 -07:00
thread launcher config dir through app control and overlay calls
- startOverlay and isRunningAppControlServerAvailable accept explicit configDir to avoid re-resolving from env mid-flight - emit connection-change on reconnect when previously connected - handle errored client sockets in app control server with logWarn and destroy
This commit is contained in:
+7
-3
@@ -1006,6 +1006,7 @@ export async function startOverlay(
|
||||
args: Args,
|
||||
socketPath: string,
|
||||
extraAppArgs: string[] = [],
|
||||
configDir: string = getLauncherConfigDir(),
|
||||
): Promise<void> {
|
||||
const backend = detectBackend(args.backend);
|
||||
log('info', args.logLevel, `Starting SubMiner overlay (backend: ${backend})...`);
|
||||
@@ -1024,7 +1025,7 @@ export async function startOverlay(
|
||||
if (args.useTexthooker) overlayArgs.push('--texthooker');
|
||||
|
||||
const controlResult = await sendAppControlCommand(overlayArgs, {
|
||||
configDir: getLauncherConfigDir(),
|
||||
configDir,
|
||||
});
|
||||
if (controlResult.ok) {
|
||||
log('debug', args.logLevel, 'Attached to running SubMiner app via control socket');
|
||||
@@ -1107,9 +1108,12 @@ function getLauncherConfigDir(): string {
|
||||
});
|
||||
}
|
||||
|
||||
export async function isRunningAppControlServerAvailable(logLevel: LogLevel): Promise<boolean> {
|
||||
export async function isRunningAppControlServerAvailable(
|
||||
logLevel: LogLevel,
|
||||
configDir: string = getLauncherConfigDir(),
|
||||
): Promise<boolean> {
|
||||
const available = await checkAppControlServerAvailable({
|
||||
configDir: getLauncherConfigDir(),
|
||||
configDir,
|
||||
});
|
||||
if (available) {
|
||||
log('debug', logLevel, 'Running SubMiner app control socket detected');
|
||||
|
||||
Reference in New Issue
Block a user