mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
Merge branch 'dillon/34.6-jenkins-vapor' into vapor/development
This commit is contained in:
+1
-1
@@ -97,7 +97,7 @@ class FetchContainersFromYdPortalV2Processor
|
||||
public function execute(PackingList $packingList)
|
||||
{
|
||||
Log::info('FetchContainersFromYdPortalV2Processor starts with packingList id '. $packingList->id);
|
||||
return;
|
||||
// return;
|
||||
|
||||
$time_start = microtime(true);
|
||||
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ class FetchContainersUpdatesFromYdPortalV2Processor
|
||||
public function execute(Container $container)
|
||||
{
|
||||
Log::info('FetchContainersUpdatesFromYdPortalV2Processor starts with container id ' . $container->id);
|
||||
return;
|
||||
// return;
|
||||
|
||||
$time_start = microtime(true);
|
||||
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ class FetchDeliveryUpdatesFromYdPortalV2Processor
|
||||
$packingList = PackingList::where('id', $packingListId)->first();
|
||||
|
||||
Log::info('FetchDeliveryUpdatesFromYdPortalV2Processor starts with packingList id ' . json_encode($packingList) );
|
||||
return;
|
||||
// return;
|
||||
|
||||
if(!$packingList->reference) return;
|
||||
$time_start = microtime(true);
|
||||
|
||||
+1
-2
@@ -205,8 +205,7 @@ class CheckStorageInvoiceTransactionProcessor
|
||||
$price_cbm = $pricePerCBM * $cbm * $resultNumberOfDaysExceeded;
|
||||
$dateToCompare = Carbon::parse(env('SST_START_DATE', '2024-04-01 00:00:00'));
|
||||
|
||||
|
||||
LogHelper::channel('storage_invoices')->info('storageInvoice: '.json_encode($storageInvoice).', $transaction->status: '.$transaction->status);
|
||||
LogHelper::channel('storage_invoices')->info('dateToCompare: '.json_encode($dateToCompare));
|
||||
if(!$storageInvoice && $resultNumberOfDaysExceeded > 0 && $transaction->status != ApprovalStatus::COMPLETED){
|
||||
LogHelper::channel('storage_invoices')->info('Created $transaction->id: '.$transaction->id);
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('STOR-');
|
||||
|
||||
@@ -43,9 +43,9 @@ class ProcessYDPortalDataV2Command extends Command
|
||||
{
|
||||
$jobs = [];
|
||||
$jobs = array_merge($jobs, $this->fetchPackingListsFromYdPortalV2CommandJobs());
|
||||
// $jobs = array_merge($jobs, $this->fetchContainersFromYdPortalV2CommandJobs());
|
||||
// $jobs = array_merge($jobs, $this->fetchContainersUpdatesFromYdPortalV2CommandJob());
|
||||
// $jobs = array_merge($jobs, $this->fetchDeliveryUpdatesFromYdPortalV2CommandJobs());
|
||||
$jobs = array_merge($jobs, $this->fetchContainersFromYdPortalV2CommandJobs());
|
||||
$jobs = array_merge($jobs, $this->fetchContainersUpdatesFromYdPortalV2CommandJob());
|
||||
$jobsWithDelay = array_merge($jobs, $this->fetchDeliveryUpdatesFromYdPortalV2CommandJobs());
|
||||
|
||||
// The following job is intentionally excluded
|
||||
////$jobs = array_merge($jobs, $this->fetchOrderListsFromYdPortalV2CommandJob());
|
||||
@@ -55,6 +55,12 @@ class ProcessYDPortalDataV2Command extends Command
|
||||
foreach ($jobs as $job) {
|
||||
dispatch($job);
|
||||
}
|
||||
|
||||
foreach ($jobsWithDelay as $index => $job) {
|
||||
// Delay each job by 2 seconds multiplied by its index
|
||||
dispatch($job)->delay(now()->addSeconds($index * 1));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function fetchPackingListsFromYdPortalV2CommandJobs(){
|
||||
@@ -72,9 +78,9 @@ class ProcessYDPortalDataV2Command extends Command
|
||||
$count = 0;
|
||||
for ($x = $from; $x <= $to; $x++) {
|
||||
|
||||
if ($count >= 2) {
|
||||
break;
|
||||
}
|
||||
// if ($count >= 2) {
|
||||
// break;
|
||||
// }
|
||||
|
||||
$startDate = Carbon::today()->subDays($x);
|
||||
$startLimit = Carbon::parse('01-12-2021');
|
||||
@@ -136,15 +142,22 @@ class ProcessYDPortalDataV2Command extends Command
|
||||
})->doesntHave('transports')->get()->reverse();
|
||||
|
||||
$count = 0;
|
||||
foreach ($packingLists->chunk(50) as $chunk) {
|
||||
foreach ($chunk as $packingList){
|
||||
// $processor = app(FetchDeliveryUpdatesFromYdPortalV2Processor::class);
|
||||
// $processor->execute($packingList);
|
||||
$jobs[] = new FetchDeliveryUpdatesFromYdPortalV2CommandJob($packingList->id);
|
||||
Log::info('Dispatched FetchDeliveryUpdatesFromYdPortalV2CommandJob for packingList with id ' . $packingList->id);
|
||||
$count++;
|
||||
foreach ($packingLists as $packingList) {
|
||||
if ($count >= 500) {
|
||||
break;
|
||||
}
|
||||
|
||||
// foreach ($packingLists->chunk(50) as $chunk) {
|
||||
// foreach ($chunk as $packingList){
|
||||
// $processor = app(FetchDeliveryUpdatesFromYdPortalV2Processor::class);
|
||||
// $processor->execute($packingList);
|
||||
$jobs[] = new FetchDeliveryUpdatesFromYdPortalV2CommandJob($packingList->id);
|
||||
Log::info('Dispatched FetchDeliveryUpdatesFromYdPortalV2CommandJob for packingList with id ' . $packingList->id);
|
||||
$count++;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
Log::info('Total FetchDeliveryUpdatesFromYdPortalV2CommandJob count($packingLists): ' . count($packingLists));
|
||||
Log::info('Total FetchDeliveryUpdatesFromYdPortalV2CommandJob dispatched: ' . $count);
|
||||
|
||||
return $jobs;
|
||||
|
||||
+26
-26
@@ -38,39 +38,39 @@ class Kernel extends ConsoleKernel
|
||||
->dailyAt('01:00')
|
||||
->withoutOverlapping();
|
||||
|
||||
//cief todo: disable commands to avoid unintentional interfering with production starts
|
||||
// $schedule->command('curl-vt-command')
|
||||
// ->cron('0 8 * * *')
|
||||
// ->withoutOverlapping();
|
||||
if(env('APP_ENV') === 'production'){
|
||||
$schedule->command('curl-vt-command')
|
||||
->cron('0 8 * * *')
|
||||
->withoutOverlapping();
|
||||
|
||||
// $schedule->command('curl-yd-order-list-command')
|
||||
// ->cron('0 9-18/3 * * *')
|
||||
// ->withoutOverlapping();
|
||||
$schedule->command('curl-yd-order-list-command')
|
||||
->cron('0 9-18/3 * * *')
|
||||
->withoutOverlapping();
|
||||
|
||||
// $schedule->command('fix-packinglist-command')
|
||||
// ->cron('30 9-18/3 * * *')
|
||||
// ->withoutOverlapping();
|
||||
$schedule->command('fix-packinglist-command')
|
||||
->cron('30 9-18/3 * * *')
|
||||
->withoutOverlapping();
|
||||
|
||||
// $schedule->command('fix-duplicate-container-reference-command')
|
||||
// ->cron('0 1 * * *')
|
||||
// ->withoutOverlapping();
|
||||
$schedule->command('fix-duplicate-container-reference-command')
|
||||
->cron('0 1 * * *')
|
||||
->withoutOverlapping();
|
||||
|
||||
// $schedule->command('invoice-generate-command')
|
||||
// ->hourly()
|
||||
// ->withoutOverlapping();
|
||||
$schedule->command('invoice-generate-command')
|
||||
->hourly()
|
||||
->withoutOverlapping();
|
||||
|
||||
// $schedule->command('billplz-failed-callback-fix-command')
|
||||
// ->hourly()
|
||||
// ->withoutOverlapping();
|
||||
$schedule->command('billplz-failed-callback-fix-command')
|
||||
->hourly()
|
||||
->withoutOverlapping();
|
||||
|
||||
// $schedule->command('check-storage-invoices-group-transactions-command')
|
||||
// ->dailyAt('0:01')
|
||||
// ->withoutOverlapping();
|
||||
$schedule->command('check-storage-invoices-group-transactions-command')
|
||||
->dailyAt('0:01')
|
||||
->withoutOverlapping();
|
||||
|
||||
// $schedule->command('permits-reminder-send-command')
|
||||
// ->dailyAt('09:30')
|
||||
// ->withoutOverlapping();
|
||||
//cief todo: disable commands to avoid unintentional interfering with production ends
|
||||
$schedule->command('permits-reminder-send-command')
|
||||
->dailyAt('09:30')
|
||||
->withoutOverlapping();
|
||||
}
|
||||
}
|
||||
//Commands Version 1: Before AWS
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user