Skip to content

Commit

Permalink
add schedule for migrate fresh seeder
Browse files Browse the repository at this point in the history
  • Loading branch information
Shipu committed Aug 12, 2023
1 parent d727fe9 commit 4243ef9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
APP_NAME=Laravel
APP_NAME=Dinero
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_URL=http://dinero.test
APP_DEMO=false

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
Expand Down
4 changes: 3 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
if(config('app.demo')) {
$schedule->command('migrate:fresh --seed')->everySixHours();
}
}

/**
Expand Down
2 changes: 2 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,6 @@
// 'Example' => App\Facades\Example::class,
])->toArray(),

'demo' => env('APP_DEMO', false),

];
11 changes: 11 additions & 0 deletions docker/app/supervisor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@ startsecs=0
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0

[program:laravel-worker-schedule]
process_name=%(program_name)s_%(process_num)02d
directory=/var/www/html
command=php artisan schedule:work
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true
stdout_logfile= /var/www/html/storage/logs/worker1.log

0 comments on commit 4243ef9

Please sign in to comment.