agg
This commit is contained in:
@@ -51,7 +51,7 @@ class ProductUpdateGm extends Command
|
||||
set_time_limit(0);
|
||||
ini_set("memory_limit", "512M");
|
||||
$settingora = Setting::where('key', 'update_products')->first();
|
||||
$productLogger = new ProductLogger($settingora, 'updateproducts');
|
||||
$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");
|
||||
|
||||
@@ -1472,6 +1472,7 @@ function setProductFromGM($article, $initlog, ProductLogger &$passproductLogger)
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$productLogger->addLog('server_issues', $article->IdArticolo . ' - ' . $article->Titolo . "\n");
|
||||
$productLogger->setAggiornato(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,10 +18,13 @@ class ProductLogger
|
||||
|
||||
protected $aggiornato = false;
|
||||
|
||||
public function __construct($settingOra, $channel)
|
||||
protected $scrivisoloseaggiornato = false;
|
||||
|
||||
public function __construct($settingOra, $channel, $scrivisoloseaggiornato = false)
|
||||
{
|
||||
$this->settingOra = $settingOra;
|
||||
$this->channel = $channel;
|
||||
$this->scrivisoloseaggiornato = $scrivisoloseaggiornato;
|
||||
$this->init();
|
||||
}
|
||||
|
||||
@@ -53,7 +56,7 @@ class ProductLogger
|
||||
// Log::warning('Impossibile eseguire il metodo save() su $this->settingOra, non è un oggetto o il metodo non esiste.');
|
||||
}
|
||||
|
||||
if (true) {
|
||||
if (($this->scrivisoloseaggiornato && $this->aggiornato) || !$this->scrivisoloseaggiornato) {
|
||||
Log::channel($this->channel)->notice($this->concatenateLogs());
|
||||
|
||||
Mail::raw($this->concatenateLogs(), function ($message) use ($descr) {
|
||||
|
||||
Reference in New Issue
Block a user