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.

Update cleanup script and version numbers

Andras Bacsai55dd1ab0a13c
diff --git a/app/Console/Commands/CleanupDatabase.php b/app/Console/Commands/CleanupDatabase.php
new file mode 100644
index 0000000000..779b322184
--- /dev/null
+++ b/app/Console/Commands/CleanupDatabase.php
@@ -0,0 +1,60 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Redis;
+
+class CleanupQueue extends Command
+{
+ protected $signature = 'cleanup:database {--yes}';
+ protected $description = 'Cleanup database';
+
+ public function handle()
+ {
+ echo "Running database cleanup...\n";
+ $keep_days = 60;
+
+ // Cleanup failed jobs table
+ $failed_jobs = DB::table('failed_jobs')->where('failed_at', '<', now()->subDays(7));
+ $count = $failed_jobs->count();
+ echo "Delete $count entries from failed_jobs.\n";
+ if ($this->option('yes')) {
+ $failed_jobs->delete();
+ }
+
+ // Cleanup sessions table
+ $sessions = DB::table('sessions')->where('last_activity', '<', now()->subDays($keep_days)->timestamp);
+ $count = $sessions->count();
+ echo "Delete $count entries from sessions.\n";
+ if ($this->option('yes')) {
+ $sessions->delete();
+ }
+
+ // Cleanup activity_log table
+ $activity_log = DB::table('activity_log')->where('created_at', '<', now()->subDays($keep_days));
+ $count = $activity_log->count();
+ echo "Delete $count entries from activity_log.\n";
+ if ($this->option('yes')) {
+ $activity_log->delete();
+ }
+
+ // Cleanup application_deployment_queues table
+ $application_deployment_queues = DB::table('application_deployment_queues')->where('created_at', '<', now()->subDays($keep_days));
+ $count = $application_deployment_queues->count();
+ echo "Delete $count entries from application_deployment_queues.\n";
+ if ($this->option('yes')) {
+ $application_deployment_queues->delete();
+ }
+
+ // Cleanup webhooks table
+ $webhooks = DB::table('webhooks')->where('created_at', '<', now()->subDays($keep_days));
+ $count = $webhooks->count();
+ echo "Delete $count entries from webhooks.\n";
+ if ($this->option('yes')) {
+ $webhooks->delete();
+ }
+
+ }
+}
diff --git a/config/sentry.php b/config/sentry.php
index 00c5f77deb..40a4c9906a 100644
--- a/config/sentry.php
+++ b/config/sentry.php
@@ -7,7 +7,7 @@ return [
// The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
- 'release' => '4.0.0-beta.224',
+ 'release' => '4.0.0-beta.225',
// When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'),
diff --git a/config/version.php b/config/version.php
index c4e13f9def..c3f92910d0 100644
--- a/config/version.php
+++ b/config/version.php
@@ -1,3 +1,3 @@
<?php
-return '4.0.0-beta.224';
+return '4.0.0-beta.225';
diff --git a/versions.json b/versions.json
index aef226d3d4..2dab168ea2 100644
--- a/versions.json
+++ b/versions.json
@@ -4,7 +4,7 @@
"version": "3.12.36"
},
"v4": {
- "version": "4.0.0-beta.224"
+ "version": "4.0.0-beta.225"
}
}
}