mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-10-21 05:01:26 -07:00
fix(stats): harden server lifecycle and verify compiled runtime (#261)
This commit is contained in:
1 parent
f9c4e892dc
commit
383aed8bad
37 files changed
+1381
-323
No files matched your search
@@ -107,7 +107,7 @@ export interface CliCommandServiceDeps {
|
||||
mode: NonNullable<CliArgs['youtubeMode']>;
|
||||
source: CliCommandSource;
|
||||
}) => Promise<void>;
|
||||
ensureBackgroundStatsServer?: () => void;
|
||||
ensureBackgroundStatsServer?: () => Promise<void> | void;
|
||||
printHelp: () => void;
|
||||
hasMainWindow: () => boolean;
|
||||
getMultiCopyTimeoutMs: () => number;
|
||||
@@ -188,7 +188,7 @@ interface AnilistCliRuntime {
|
||||
interface AppCliRuntime {
|
||||
stop: () => void;
|
||||
hasMainWindow: () => boolean;
|
||||
ensureBackgroundStatsServer?: () => void;
|
||||
ensureBackgroundStatsServer?: () => Promise<void> | void;
|
||||
runUpdateCommand: CliCommandServiceDeps['runUpdateCommand'];
|
||||
runEnsureLinuxRuntimePluginAssetsCommand: CliCommandServiceDeps['runEnsureLinuxRuntimePluginAssetsCommand'];
|
||||
runYoutubePlaybackFlow: CliCommandServiceDeps['runYoutubePlaybackFlow'];
|
||||
@@ -400,7 +400,14 @@ export function handleCliCommand(
|
||||
}
|
||||
|
||||
if (args.start && args.background) {
|
||||
deps.ensureBackgroundStatsServer?.();
|
||||
runAsyncWithOsd(
|
||||
async () => {
|
||||
await deps.ensureBackgroundStatsServer?.();
|
||||
},
|
||||
deps,
|
||||
'ensureBackgroundStatsServer',
|
||||
'Stats server startup failed',
|
||||
);
|
||||
}
|
||||
|
||||
if (args.sessionAction) {
|
||||
|
||||
Reference in new issue
Block a user