Laravel Vapor - Code sync from Shipping Portal, test run schedule tasks with logs

This commit is contained in:
Dillon Ngo
2023-12-31 03:50:16 +08:00
parent 5728017911
commit ff53e16ceb
4 changed files with 100 additions and 11 deletions
+20 -11
View File
@@ -30,19 +30,28 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
//Commands Version 2: Laravel Vapor/AWS
$isEnabled = env('COMMANDS_V2_ENABLED', false);
if($isEnabled){
$schedule->command('dummy-command')
->everyFiveMinutes()
->withoutOverlapping();
}
//Commands Version 1: Before Laravel Vapor/AWS
else{
// $schedule->command('inspire')->hourly();
$schedule->command('mail:EmailDoToVTCommand')->dailyAt('10:00')->withoutOverlapping();
// $schedule->command('inspire')->hourly();
$schedule->command('mail:EmailDoToVTCommand')->dailyAt('10:00')->withoutOverlapping();
$schedule->command('seasonalSegmantCompany:remove')
->dailyAt('01:00')
->appendOutputTo(storage_path().'/logs/soft-delete-seasonal-segmant-company.log')
->withoutOverlapping();
$schedule->command('seasonalSegmantCompany:remove')
->dailyAt('01:00')
->appendOutputTo(storage_path().'/logs/soft-delete-seasonal-segmant-company.log')
->withoutOverlapping();
$schedule->command('delete:bulk-download-files')
->hourly()
->appendOutputTo(storage_path().'/logs/delete-bulk-download-files.log')
->withoutOverlapping();
$schedule->command('delete:bulk-download-files')
->hourly()
->appendOutputTo(storage_path().'/logs/delete-bulk-download-files.log')
->withoutOverlapping();
}
}
/**