diff --git a/app/Classes/Jobs/Commands/V2/HouseKeepingS3FilesV2CommandJob.php b/app/Classes/Jobs/Commands/V2/HouseKeepingS3FilesV2CommandJob.php new file mode 100644 index 00000000..4463208d --- /dev/null +++ b/app/Classes/Jobs/Commands/V2/HouseKeepingS3FilesV2CommandJob.php @@ -0,0 +1,52 @@ +allFiles($directory); + + foreach ($objects as $object) { + $s3->delete($object); + Log::info('[HouseKeepingS3FilesV2] Deleted object: ' . $object); + } + + Log::info('[HouseKeepingS3FilesV2] All files have been deleted.'); + + $endInner = Carbon::now(); + $elapsedTime = $startInner->diff($endInner)->format('%H:%I:%S'); + Log::info(Carbon::now() . ' [HouseKeepingS3FilesV2] Process ended. ElapsedTime: ' . $elapsedTime); + } + + $end = new Carbon(); + $elapsedTime = $start->diff($end)->format('%H:%I:%S'); + Log::info(Carbon::now() . ': End job - Housekeeping temporary files in S3 Bucket. ElapsedTime: ' . $elapsedTime . '.'); + } +} diff --git a/app/Console/Commands/V2/HouseKeepingS3FilesV2Command.php b/app/Console/Commands/V2/HouseKeepingS3FilesV2Command.php new file mode 100644 index 00000000..da15ff1b --- /dev/null +++ b/app/Console/Commands/V2/HouseKeepingS3FilesV2Command.php @@ -0,0 +1,23 @@ +everyFiveMinutes() ->withoutOverlapping(); - $schedule->command('email-do-to-vt-command') - ->dailyAt('10:00') + $schedule->command('housekeeping-s3-files-command') + ->everyFiveMinutes() ->withoutOverlapping(); - $schedule->command('seasonal-segmant-company-remove-command') - ->dailyAt('01:00') - ->withoutOverlapping(); + //cief todo: disable commands to avoid unintentional interfering with production starts + // $schedule->command('email-do-to-vt-command') + // ->dailyAt('10:00') + // ->withoutOverlapping(); - $schedule->command('delete-bulk-download-files-command') - ->hourly() - ->withoutOverlapping(); + // $schedule->command('seasonal-segmant-company-remove-command') + // ->dailyAt('01:00') + // ->withoutOverlapping(); - $schedule->command('new-user-registration-expire-check-command') - //->dailyAt('23:55') //cief todo: original, to be reverted back to this - ->everyFifteenMinutes() - ->withoutOverlapping(); + // $schedule->command('delete-bulk-download-files-command') + // ->hourly() + // ->withoutOverlapping(); - $schedule->command('booking-expired-command') - ->dailyAt('02:00') - ->withoutOverlapping(); + // $schedule->command('new-user-registration-expire-check-command') + // //->dailyAt('23:55') //cief todo: original, to be reverted back to this + // ->everyFifteenMinutes() + // ->withoutOverlapping(); + // $schedule->command('booking-expired-command') + // ->dailyAt('02:00') + // ->withoutOverlapping(); + //cief todo: disable commands to avoid unintentional interfering with production ends + + // DISABLED BY DEFAULT // $schedule->command('purchase-order-autofill-command') // ->dailyAt('03:00') // ->withoutOverlapping();