fix: removing repacks from worker threads to fix race condition

This commit is contained in:
Chubby Granny Chaser 2024-06-03 23:09:47 +01:00
parent 4559e23610
commit ea923d5082
No known key found for this signature in database
13 changed files with 71 additions and 105 deletions

View file

@ -4,7 +4,8 @@ import flexSearch from "flexsearch";
import type { GameShop, CatalogueEntry, SteamGame } from "@types";
import { getSteamAppAsset } from "@main/helpers";
import { repacksWorker, steamGamesWorker } from "@main/workers";
import { steamGamesWorker } from "@main/workers";
import { RepacksManager } from "@main/services";
export interface SearchGamesArgs {
query?: string;
@ -29,11 +30,8 @@ export const searchSteamGames = async (
name: "search",
})) as SteamGame[];
const result = await repacksWorker.run(
steamGames.map((game) => convertSteamGameToCatalogueEntry(game)),
{
name: "findRepacksForCatalogueEntries",
}
const result = RepacksManager.findRepacksForCatalogueEntries(
steamGames.map((game) => convertSteamGameToCatalogueEntry(game))
);
return orderBy(