coolify/app/Providers/AppServiceProvider.php

41 lines
1.1 KiB
PHP
Raw Normal View History

2023-03-17 15:33:48 +01:00
<?php
namespace App\Providers;
2023-05-03 07:15:45 +02:00
use App\Jobs\HandleCoolifyTaskInQueue;
2023-03-30 09:47:04 +02:00
use Illuminate\Queue\Events\JobProcessed;
2023-04-14 10:00:42 +02:00
use Illuminate\Support\Facades\Process;
2023-03-30 09:47:04 +02:00
use Illuminate\Support\Facades\Queue;
2023-03-17 15:33:48 +01:00
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
2023-04-14 10:00:42 +02:00
// @TODO: Is this the best place to run the seeder?
// if (env('APP_ENV') === 'production') {
// dump('Seed default data.');
// Process::run('php artisan db:seed --class=ProductionSeeder --force');
// } else {
// dump('Not in production environment.');
// }
2023-03-17 15:33:48 +01:00
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Queue::after(function (JobProcessed $event) {
// @TODO: Remove `coolify-builder` container after the remoteProcess job is finishged and remoteProcess->type == `deployment`.
2023-05-03 07:15:45 +02:00
if ($event->job->resolveName() === HandleCoolifyTaskInQueue::class) {
}
});
2023-03-17 15:33:48 +01:00
}
}