finished the purge moon ledger job

This commit is contained in:
2020-05-10 19:16:37 -05:00
parent 50b2e91ec6
commit e855350b7f

View File

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