diff --git a/app/Jobs/Commands/PurgeMoonLedgerJob.php b/app/Jobs/Commands/PurgeMoonLedgerJob.php index b292cc8c5..6c4820374 100644 --- a/app/Jobs/Commands/PurgeMoonLedgerJob.php +++ b/app/Jobs/Commands/PurgeMoonLedgerJob.php @@ -2,16 +2,36 @@ namespace App\Jobs\Commands; +//Internal Libraries use Illuminate\Bus\Queueable; use Illuminate\Queue\SerializesModels; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; +use Log; +use Carbon\Carbon; + +//App Models +use App\Models\CorpMoonLedger; class PurgeMoonLedgerJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + /** + * Timeout in seconds + * + * @var int + */ + public $timeout = 3600; + + /** + * Retries + * + * @var int + */ + public $retries = 3; + /** * Create a new job instance. * @@ -29,6 +49,9 @@ class PurgeMoonLedgerJob implements ShouldQueue */ public function handle() { - // + $previous = Carbon::now()->subDays(60); + + //Remove old ledger entries + CorpMoonLedger::where('created_at', '<', $previous)->delete(); } }