Merge pull request 'commented alert mail rules logic from boot method' (#19) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #19
This commit was merged in pull request #19.
This commit is contained in:
@@ -69,82 +69,82 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
ini_set('max_execution_time', 300); // 300 seconds = 5 minutes
|
ini_set('max_execution_time', 300); // 300 seconds = 5 minutes
|
||||||
ini_set('memory_limit', '512M'); // 512MB
|
ini_set('memory_limit', '512M'); // 512MB
|
||||||
|
|
||||||
$schedule = app(Schedule::class);
|
// $schedule = app(Schedule::class);
|
||||||
|
|
||||||
$productionRules = AlertMailRule::where('module', 'ProductionQuantities')
|
// $productionRules = AlertMailRule::where('module', 'ProductionQuantities')
|
||||||
->where('rule_name', 'ProductionMail')
|
// ->where('rule_name', 'ProductionMail')
|
||||||
->select('plant', 'schedule_type')
|
// ->select('plant', 'schedule_type')
|
||||||
->distinct()
|
// ->distinct()
|
||||||
->get();
|
// ->get();
|
||||||
|
|
||||||
foreach ($productionRules as $rule) {
|
// foreach ($productionRules as $rule) {
|
||||||
$type = $rule->schedule_type;
|
// $type = $rule->schedule_type;
|
||||||
$plantId = $rule->plant;
|
// $plantId = $rule->plant;
|
||||||
|
|
||||||
$command = $schedule->command('send:production-report', [$type, $plantId]);
|
// $command = $schedule->command('send:production-report', [$type, $plantId]);
|
||||||
// ->appendOutputTo(storage_path('logs/scheduler.log'));
|
// // ->appendOutputTo(storage_path('logs/scheduler.log'));
|
||||||
|
|
||||||
switch ($type) {
|
// switch ($type) {
|
||||||
case 'Live':
|
// case 'Live':
|
||||||
$command->everyMinute();
|
// $command->everyMinute();
|
||||||
break;
|
// break;
|
||||||
case 'Hourly':
|
// case 'Hourly':
|
||||||
$command->hourly();
|
// $command->hourly();
|
||||||
break;
|
// break;
|
||||||
case 'Daily':
|
// case 'Daily':
|
||||||
$command->dailyAt('07:59');
|
// $command->dailyAt('07:59');
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Invoice report scheduling
|
// // Invoice report scheduling
|
||||||
$invoiceRules = AlertMailRule::where('module', 'InvoiceValidation')
|
// $invoiceRules = AlertMailRule::where('module', 'InvoiceValidation')
|
||||||
->select('plant', 'schedule_type')
|
// ->select('plant', 'schedule_type')
|
||||||
->distinct()
|
// ->distinct()
|
||||||
->get();
|
// ->get();
|
||||||
|
|
||||||
foreach ($invoiceRules as $rule) {
|
// foreach ($invoiceRules as $rule) {
|
||||||
$type = $rule->schedule_type;
|
// $type = $rule->schedule_type;
|
||||||
$plantId = $rule->plant;
|
// $plantId = $rule->plant;
|
||||||
|
|
||||||
$command = $schedule->command('send:invoice-report', [$type, $plantId]);
|
// $command = $schedule->command('send:invoice-report', [$type, $plantId]);
|
||||||
|
|
||||||
switch ($type) {
|
// switch ($type) {
|
||||||
case 'Live':
|
// case 'Live':
|
||||||
$command->everyMinute();
|
// $command->everyMinute();
|
||||||
break;
|
// break;
|
||||||
case 'Hourly':
|
// case 'Hourly':
|
||||||
$command->hourly();
|
// $command->hourly();
|
||||||
break;
|
// break;
|
||||||
case 'Daily':
|
// case 'Daily':
|
||||||
$command->dailyAt('07:59');
|
// $command->dailyAt('07:59');
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Invoice Data Report Scheduling
|
// // Invoice Data Report Scheduling
|
||||||
$invoiceDataRules = AlertMailRule::where('module', 'InvoiceDataReport')
|
// $invoiceDataRules = AlertMailRule::where('module', 'InvoiceDataReport')
|
||||||
->select('plant', 'schedule_type')
|
// ->select('plant', 'schedule_type')
|
||||||
->distinct()
|
// ->distinct()
|
||||||
->get();
|
// ->get();
|
||||||
|
|
||||||
foreach ($invoiceDataRules as $rule) {
|
// foreach ($invoiceDataRules as $rule) {
|
||||||
$type = $rule->schedule_type;
|
// $type = $rule->schedule_type;
|
||||||
$plantId = $rule->plant;
|
// $plantId = $rule->plant;
|
||||||
|
|
||||||
$command = $schedule->command('send:invoice-data-report', [$type, $plantId]);
|
// $command = $schedule->command('send:invoice-data-report', [$type, $plantId]);
|
||||||
|
|
||||||
switch ($type) {
|
// switch ($type) {
|
||||||
case 'Live':
|
// case 'Live':
|
||||||
$command->everyMinute();
|
// $command->everyMinute();
|
||||||
break;
|
// break;
|
||||||
case 'Hourly':
|
// case 'Hourly':
|
||||||
$command->hourly();
|
// $command->hourly();
|
||||||
break;
|
// break;
|
||||||
case 'Daily':
|
// case 'Daily':
|
||||||
$command->dailyAt('10:00');
|
// $command->dailyAt('10:00');
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user