commented alert mail rules logic from boot method
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / review (pull_request) Failing after 25s
Laravel Pint / pint (pull_request) Successful in 2m18s
Laravel Larastan / larastan (pull_request) Failing after 2m46s

This commit is contained in:
dhanabalan
2025-11-29 11:45:37 +05:30
parent 80806d0f17
commit f45bb7b74b

View File

@@ -69,82 +69,82 @@ class AppServiceProvider extends ServiceProvider
ini_set('max_execution_time', 300); // 300 seconds = 5 minutes
ini_set('memory_limit', '512M'); // 512MB
$schedule = app(Schedule::class);
// $schedule = app(Schedule::class);
$productionRules = AlertMailRule::where('module', 'ProductionQuantities')
->where('rule_name', 'ProductionMail')
->select('plant', 'schedule_type')
->distinct()
->get();
// $productionRules = AlertMailRule::where('module', 'ProductionQuantities')
// ->where('rule_name', 'ProductionMail')
// ->select('plant', 'schedule_type')
// ->distinct()
// ->get();
foreach ($productionRules as $rule) {
$type = $rule->schedule_type;
$plantId = $rule->plant;
// foreach ($productionRules as $rule) {
// $type = $rule->schedule_type;
// $plantId = $rule->plant;
$command = $schedule->command('send:production-report', [$type, $plantId]);
// ->appendOutputTo(storage_path('logs/scheduler.log'));
// $command = $schedule->command('send:production-report', [$type, $plantId]);
// // ->appendOutputTo(storage_path('logs/scheduler.log'));
switch ($type) {
case 'Live':
$command->everyMinute();
break;
case 'Hourly':
$command->hourly();
break;
case 'Daily':
$command->dailyAt('07:59');
break;
}
}
// switch ($type) {
// case 'Live':
// $command->everyMinute();
// break;
// case 'Hourly':
// $command->hourly();
// break;
// case 'Daily':
// $command->dailyAt('07:59');
// break;
// }
// }
// Invoice report scheduling
$invoiceRules = AlertMailRule::where('module', 'InvoiceValidation')
->select('plant', 'schedule_type')
->distinct()
->get();
// // Invoice report scheduling
// $invoiceRules = AlertMailRule::where('module', 'InvoiceValidation')
// ->select('plant', 'schedule_type')
// ->distinct()
// ->get();
foreach ($invoiceRules as $rule) {
$type = $rule->schedule_type;
$plantId = $rule->plant;
// foreach ($invoiceRules as $rule) {
// $type = $rule->schedule_type;
// $plantId = $rule->plant;
$command = $schedule->command('send:invoice-report', [$type, $plantId]);
// $command = $schedule->command('send:invoice-report', [$type, $plantId]);
switch ($type) {
case 'Live':
$command->everyMinute();
break;
case 'Hourly':
$command->hourly();
break;
case 'Daily':
$command->dailyAt('07:59');
break;
}
}
// switch ($type) {
// case 'Live':
// $command->everyMinute();
// break;
// case 'Hourly':
// $command->hourly();
// break;
// case 'Daily':
// $command->dailyAt('07:59');
// break;
// }
// }
// Invoice Data Report Scheduling
$invoiceDataRules = AlertMailRule::where('module', 'InvoiceDataReport')
->select('plant', 'schedule_type')
->distinct()
->get();
// // Invoice Data Report Scheduling
// $invoiceDataRules = AlertMailRule::where('module', 'InvoiceDataReport')
// ->select('plant', 'schedule_type')
// ->distinct()
// ->get();
foreach ($invoiceDataRules as $rule) {
$type = $rule->schedule_type;
$plantId = $rule->plant;
// foreach ($invoiceDataRules as $rule) {
// $type = $rule->schedule_type;
// $plantId = $rule->plant;
$command = $schedule->command('send:invoice-data-report', [$type, $plantId]);
// $command = $schedule->command('send:invoice-data-report', [$type, $plantId]);
switch ($type) {
case 'Live':
$command->everyMinute();
break;
case 'Hourly':
$command->hourly();
break;
case 'Daily':
$command->dailyAt('10:00');
break;
}
}
// switch ($type) {
// case 'Live':
// $command->everyMinute();
// break;
// case 'Hourly':
// $command->hourly();
// break;
// case 'Daily':
// $command->dailyAt('10:00');
// break;
// }
// }
}
}