mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-20 01:33:56 +00:00
Merge pull request #154 from hydralauncher/feat/format-playtime-in-hours
Feat/format playtime in hours
This commit is contained in:
@@ -8,20 +8,18 @@ import { WindowManager } from "./window-manager";
|
||||
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
|
||||
export const startProcessWatcher = async () => {
|
||||
const sleepTime = 300;
|
||||
const sleepTime = 500;
|
||||
const gamesPlaytime = new Map<number, number>();
|
||||
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
await sleep(sleepTime);
|
||||
|
||||
const games = await gameRepository.find({
|
||||
where: {
|
||||
executablePath: Not(IsNull()),
|
||||
},
|
||||
});
|
||||
|
||||
if (games.length == 0) {
|
||||
if (games.length === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -71,5 +69,7 @@ export const startProcessWatcher = async () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await sleep(sleepTime);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user