Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

refactor: Update cleanup schedule to run daily at midnight

Andras Bacsai9861ad40457c
diff --git a/database/migrations/2024_09_07_185402_change_cleanup_schedule.php b/database/migrations/2024_09_07_185402_change_cleanup_schedule.php
new file mode 100644
index 0000000000..e2c24761c7
--- /dev/null
+++ b/database/migrations/2024_09_07_185402_change_cleanup_schedule.php
@@ -0,0 +1,26 @@
+<?php
+
+use App\Models\ServerSetting;
+use Illuminate\Database\Migrations\Migration;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ */
+ public function up(): void
+ {
+ $serverSettings = ServerSetting::all();
+ foreach ($serverSettings as $serverSetting) {
+ if ($serverSetting->force_docker_cleanup && $serverSetting->docker_cleanup_frequency === '*/10 * * * *') {
+ $serverSetting->docker_cleanup_frequency = '0 0 * * *';
+ $serverSetting->save();
+ }
+ }
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void {}
+};