updates to files

This commit is contained in:
2019-05-05 01:24:31 -05:00
parent c752f5679f
commit 1f43d039e0
13 changed files with 194 additions and 169 deletions
+20 -2
View File
@@ -14,6 +14,8 @@ use App\Library\Finances\Helper\FinanceHelper;
//App Models
use App\Models\Jobs\JobProcessWalletTransaction;
use App\Models\Jobs\JobError;
use App\Models\Jobs\JobStatus;
class ProcessWalletTransactionJob implements ShouldQueue
{
@@ -61,6 +63,12 @@ class ProcessWalletTransactionJob implements ShouldQueue
//After the job is completed, delete the job
$this->delete();
//If the job is completed, mark down the completed job in the status table for jobs
$job = new JobStatus;
$job->job_name = $this->getName();
$job->complete = true;
$job->save();
}
/**
@@ -70,7 +78,17 @@ class ProcessWalletTransactionJob implements ShouldQueue
* @return void
*/
public function failed($exception) {
// Send user notification of the failure, etc.
dd($exception);
//Save the error in the database
$job = new JobStatus;
$job->job_name = $this->getName();
$job->complete = false;
$job->save();
//Save the job error
$error = new JobError;
$error->job_id = $job->id;
$error->job_name = $this->getName();
$error->error = $exception;
$error->save();
}
}