mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
Merge pull request #154 from hydralauncher/feat/format-playtime-in-hours
Feat/format playtime in hours
This commit is contained in:
commit
d7b92b472d
8 changed files with 45 additions and 24 deletions
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue