mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: migrating repacks to a worker
This commit is contained in:
parent
eb3eb88f23
commit
5a85033486
19 changed files with 204 additions and 147 deletions
|
@ -1,8 +1,13 @@
|
|||
import { DownloadManager, SearchEngine, startMainLoop } from "./services";
|
||||
import { gameRepository, userPreferencesRepository } from "./repository";
|
||||
import { DownloadManager, startMainLoop } from "./services";
|
||||
import {
|
||||
gameRepository,
|
||||
repackRepository,
|
||||
userPreferencesRepository,
|
||||
} from "./repository";
|
||||
import { UserPreferences } from "./entity";
|
||||
import { RealDebridClient } from "./services/real-debrid";
|
||||
import { Not } from "typeorm";
|
||||
import { repacksWorker } from "./workers";
|
||||
|
||||
startMainLoop();
|
||||
|
||||
|
@ -21,7 +26,16 @@ const loadState = async (userPreferences: UserPreferences | null) => {
|
|||
});
|
||||
|
||||
if (game) DownloadManager.startDownload(game);
|
||||
await SearchEngine.updateRepacks();
|
||||
|
||||
repackRepository
|
||||
.find({
|
||||
order: {
|
||||
createdAt: "DESC",
|
||||
},
|
||||
})
|
||||
.then((repacks) => {
|
||||
repacksWorker.run(repacks, { name: "setRepacks" });
|
||||
});
|
||||
};
|
||||
|
||||
userPreferencesRepository
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue