Skip to content

Commit

Permalink
altro logging per comandi invio notifiche
Browse files Browse the repository at this point in the history
  • Loading branch information
madbob committed May 19, 2024
1 parent 3c27fba commit 9622bb1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions code/app/Console/Commands/RemindOrders.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ public function handle()
}
}

$hub = app()->make('GlobalScopeHub');

foreach($notifications as $gas_id => $orders) {
Log::info('Invio promemoria per ordini ' . join(', ', $orders));
$hub->setGas($gas_id);
NotifyRemindOrder::dispatch($orders);
}

Expand Down
2 changes: 1 addition & 1 deletion code/app/Jobs/NotifyRemindOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function handle()
foreach($this->orders_id as $order_id) {
$order = Order::find($order_id);
if (is_null($order)) {
\Log::error('Ordine non trovato per notifica reminder: ' . $order_id . ', ' . $gas->id);
\Log::error('Ordine non trovato per notifica reminder: ' . $order_id);
continue;
}

Expand Down
6 changes: 6 additions & 0 deletions code/app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,17 @@ protected function enforceInstance($event)

URL::forceRootUrl(env('APP_URL'));
}
else {
\Log::error('Job senza env file definito!');
}

$gas_id = $payload['gas_id'] ?? null;
if ($gas_id) {
app()->make('GlobalScopeHub')->setGas($gas_id);
}
else {
\Log::error('Job senza GAS definito!');
}

/*
Per scrupolo, all'inizio di ogni job invalido tutte le cache tenute
Expand Down

0 comments on commit 9622bb1

Please sign in to comment.