mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-12 12:10:41 -05:00
Hub Import Mod Removal
Removes mods that are no longer on the hub.
This commit is contained in:
parent
424a329688
commit
755aad8da6
@ -51,6 +51,9 @@ class ImportHubDataJob implements ShouldBeUnique, ShouldQueue
|
||||
$this->importMods();
|
||||
$this->importModVersions();
|
||||
|
||||
// Remove mods that are no longer on the hub.
|
||||
$this->removeDeletedMods();
|
||||
|
||||
// Ensure that we've disconnected from the Hub database, clearing temporary tables.
|
||||
DB::connection('mysql_hub')->disconnect();
|
||||
|
||||
@ -965,6 +968,19 @@ class ImportHubDataJob implements ShouldBeUnique, ShouldQueue
|
||||
}, 'versionID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove mods that are no longer on the Hub.
|
||||
*/
|
||||
private function removeDeletedMods(): void
|
||||
{
|
||||
$mods = Mod::select('hub_id')->all();
|
||||
foreach ($mods as $mod) {
|
||||
if (DB::connection('mysql_hub')->table('filebase1_file')->where('fileID', $mod->hub_id)->doesntExist()) {
|
||||
$mod->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The job failed to process.
|
||||
*/
|
||||
|
@ -207,7 +207,7 @@ return [
|
||||
'maxJobs' => 0,
|
||||
'memory' => 256,
|
||||
'tries' => 1,
|
||||
'timeout' => 1500, // 25 Minutes
|
||||
'timeout' => 2700, // 45 Minutes
|
||||
'nice' => 0,
|
||||
],
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user