SyncStaleDiditVerifications.php 638 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Tasks;
  3. use Illuminate\Support\Facades\Artisan;
  4. use Illuminate\Support\Facades\Log;
  5. use Throwable;
  6. class SyncStaleDiditVerifications
  7. {
  8. public function __invoke(): void
  9. {
  10. try {
  11. Artisan::call('didit:sync', ['--stale-hours' => 6, '--limit' => 100]);
  12. Log::channel('didit')->info('Reconciliacao agendada concluida', [
  13. 'saida' => trim(Artisan::output()),
  14. ]);
  15. } catch (Throwable $e) {
  16. Log::channel('didit')->error('Falha na reconciliacao agendada', [
  17. 'exception' => $e->getMessage(),
  18. ]);
  19. }
  20. }
  21. }