This commit is contained in:
paoloar77
2024-08-22 22:29:16 +02:00
parent 239475afde
commit 1661d07a1d

View File

@@ -47,17 +47,18 @@ class ProductUpdateGm extends Command
*/
public function handle()
{
set_time_limit(0);
ini_set("memory_limit", "512M");
$settingora = Setting::where('key', 'update_products')->first();
$productLogger = new ProductLogger($settingora, 'updateproducts', true);
try {
set_time_limit(0);
ini_set("memory_limit", "512M");
$settingora = Setting::where('key', 'update_products')->first();
$productLogger = new ProductLogger($settingora, 'updateproducts', true);
$productLogger->addLog('inserted', 'PRODOTTI INSERITI' . "\n");
$productLogger->addLog('not_inserted', 'EVENTUALI PRODOTTI NON INSERITI' . "\n");
$productLogger->addLog('updated', 'PRODOTTI AGGIORNATI' . "\n");
$productLogger->addLog('server_issues', 'PRODOTTI NON INSERITI PER PROBLEMI SERVER' . "\n");
$productLogger->addLog('pre_order', 'PRODOTTI IN PREVENDITA' . "\n");
echo "SettingOra: " . $settingora;
$fromtime = str_replace('-', '', $settingora->value);
@@ -99,15 +100,13 @@ class ProductUpdateGm extends Command
$productLogger->setLogandSendEmail('Aggiornamento Prodotti');
echo "************** Finito **************";
} catch (\Exception $e) {
echo $e->getMessage();
if ($productLogger) {
$productLogger->addLog('Error', $e->getMessage());
$productLogger->setLogandSendEmail('Aggiornamento Prodotti');
}
}
}
}
}