mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
fix: removing repacks from worker threads to fix race condition
This commit is contained in:
parent
4559e23610
commit
ea923d5082
13 changed files with 71 additions and 105 deletions
|
@ -1,18 +1,15 @@
|
|||
import { DownloadManager, startMainLoop } from "./services";
|
||||
import {
|
||||
gameRepository,
|
||||
repackRepository,
|
||||
userPreferencesRepository,
|
||||
} from "./repository";
|
||||
import { DownloadManager, RepacksManager, startMainLoop } from "./services";
|
||||
import { gameRepository, userPreferencesRepository } from "./repository";
|
||||
import { UserPreferences } from "./entity";
|
||||
import { RealDebridClient } from "./services/real-debrid";
|
||||
import { Not } from "typeorm";
|
||||
import { repacksWorker } from "./workers";
|
||||
import { fetchDownloadSourcesAndUpdate } from "./helpers";
|
||||
|
||||
startMainLoop();
|
||||
|
||||
const loadState = async (userPreferences: UserPreferences | null) => {
|
||||
await RepacksManager.updateRepacks();
|
||||
|
||||
import("./events");
|
||||
|
||||
if (userPreferences?.realDebridApiToken)
|
||||
|
@ -28,14 +25,6 @@ const loadState = async (userPreferences: UserPreferences | null) => {
|
|||
|
||||
if (game) DownloadManager.startDownload(game);
|
||||
|
||||
const repacks = await repackRepository.find({
|
||||
order: {
|
||||
createdAt: "DESC",
|
||||
},
|
||||
});
|
||||
|
||||
repacksWorker.run(repacks, { name: "setRepacks" });
|
||||
|
||||
fetchDownloadSourcesAndUpdate();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue