mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-18 08:43:57 +00:00
22 lines
732 B
TypeScript
22 lines
732 B
TypeScript
import { sleep } from "@main/helpers";
|
|
import { DownloadManager } from "./download";
|
|
import { watchProcesses } from "./process-watcher";
|
|
import { AchievementWatcherManager } from "./achievements/achievement-watcher-manager";
|
|
import { UpdateManager } from "./update-manager";
|
|
import { MAIN_LOOP_INTERVAL } from "@main/constants";
|
|
|
|
export const startMainLoop = async () => {
|
|
// eslint-disable-next-line no-constant-condition
|
|
while (true) {
|
|
await Promise.allSettled([
|
|
watchProcesses(),
|
|
DownloadManager.watchDownloads(),
|
|
AchievementWatcherManager.watchAchievements(),
|
|
DownloadManager.getSeedStatus(),
|
|
UpdateManager.checkForUpdatePeriodically(),
|
|
]);
|
|
|
|
await sleep(MAIN_LOOP_INTERVAL);
|
|
}
|
|
};
|