diff --git a/.gitea/README.md b/.github/README.md similarity index 100% rename from .gitea/README.md rename to .github/README.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4f8bc32 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,40 @@ +version: 2 +updates: + # Composer dependencies (PHP) + - package-ecosystem: "composer" + directory: "/" + schedule: + interval: "daily" + time: "15:00" # 10am EST + open-pull-requests-limit: 10 + target-branch: "develop" + labels: + - "dependencies" + assignees: + - "Refringe" + + # GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + time: "15:00" # 10am EST + open-pull-requests-limit: 10 + target-branch: "develop" + labels: + - "dependencies" + assignees: + - "Refringe" + + # npm modules (JavaScript) + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + time: "15:00" # 10am EST + open-pull-requests-limit: 10 + target-branch: "develop" + labels: + - "dependencies" + assignees: + - "Refringe" diff --git a/.gitea/logo.spt.png b/.github/logo.spt.png similarity index 100% rename from .gitea/logo.spt.png rename to .github/logo.spt.png diff --git a/.gitea/workflows/quality.yaml b/.github/workflows/quality.yaml similarity index 100% rename from .gitea/workflows/quality.yaml rename to .github/workflows/quality.yaml diff --git a/.gitea/workflows/tests.yaml b/.github/workflows/tests.yaml similarity index 100% rename from .gitea/workflows/tests.yaml rename to .github/workflows/tests.yaml diff --git a/app/Jobs/Import/ImportHubDataJob.php b/app/Jobs/Import/ImportHubDataJob.php index 28192c5..676e05b 100644 --- a/app/Jobs/Import/ImportHubDataJob.php +++ b/app/Jobs/Import/ImportHubDataJob.php @@ -57,6 +57,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(); @@ -1076,6 +1079,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')->get(); + 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. */ diff --git a/config/horizon.php b/config/horizon.php index b3a3771..f8cde95 100644 --- a/config/horizon.php +++ b/config/horizon.php @@ -207,7 +207,7 @@ return [ 'maxJobs' => 0, 'memory' => 256, 'tries' => 1, - 'timeout' => 1500, // 25 Minutes + 'timeout' => 2700, // 45 Minutes 'nice' => 0, ], ],