added some unnecessary stuff to jobs
This commit is contained in:
@@ -63,12 +63,6 @@ class ProcessWalletJournalJob implements ShouldQueue
|
||||
|
||||
$finance->GetWalletJournalPage($this->division, $this->charId, $this->page);
|
||||
|
||||
//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();
|
||||
|
||||
//After the job is completed, delete the job
|
||||
$this->delete();
|
||||
}
|
||||
@@ -81,17 +75,6 @@ class ProcessWalletJournalJob implements ShouldQueue
|
||||
*/
|
||||
public function failed($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();
|
||||
dd($exception);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,8 +42,7 @@ class ProcessWalletTransactionJob implements ShouldQueue
|
||||
{
|
||||
$this->division = $pwt->division;
|
||||
$this->charId = $pwt->charId;
|
||||
|
||||
$this->delay = 10;
|
||||
|
||||
$this->connection = 'database';
|
||||
}
|
||||
|
||||
@@ -59,12 +58,6 @@ class ProcessWalletTransactionJob implements ShouldQueue
|
||||
|
||||
$finance->GetWalletTransaction($this->division, $this->charId);
|
||||
|
||||
//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();
|
||||
|
||||
//After the job is completed, delete the job
|
||||
$this->delete();
|
||||
}
|
||||
@@ -76,17 +69,6 @@ class ProcessWalletTransactionJob implements ShouldQueue
|
||||
* @return void
|
||||
*/
|
||||
public function failed($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();
|
||||
dd($exception);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,12 +99,6 @@ class SendEveMailJob implements ShouldQueue
|
||||
} catch(RequestFailedException $e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
//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();
|
||||
|
||||
$this->delete();
|
||||
}
|
||||
@@ -117,17 +111,6 @@ class SendEveMailJob implements ShouldQueue
|
||||
*/
|
||||
public function failed($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();
|
||||
dd($exception);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateJobsStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('jobs_statuses')) {
|
||||
Schema::create('jobs_statuses', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('job_name');
|
||||
$table->boolean('complete')->default(false);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if(!Schema::hasTable('jobs_errors')) {
|
||||
Schema::create('jobs_errors', function(Blueprint $table) {
|
||||
$table->integer('job_id');
|
||||
$table->string('job_name');
|
||||
$table->text('error');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('jobs_status');
|
||||
Schema::dropIfExists('jobs_errors');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user