job status for database
This commit is contained in:
@@ -14,7 +14,6 @@ use App\Library\Finances\Helper\FinanceHelper;
|
||||
|
||||
//App Models
|
||||
use App\Models\Jobs\JobProcessWalletJournal;
|
||||
use App\Models\Jobs\JobError;
|
||||
use App\Models\Jobs\JobStatus;
|
||||
|
||||
class ProcessWalletJournalJob implements ShouldQueue
|
||||
@@ -65,6 +64,11 @@ class ProcessWalletJournalJob implements ShouldQueue
|
||||
|
||||
//After the job is completed, delete the job
|
||||
$this->delete();
|
||||
|
||||
$status = new JobStatus;
|
||||
$status->job_name = 'Process Wallet Journal';
|
||||
$status->complete = true;
|
||||
$status->save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,6 +60,11 @@ class ProcessWalletTransactionJob implements ShouldQueue
|
||||
|
||||
//After the job is completed, delete the job
|
||||
$this->delete();
|
||||
|
||||
$status = new JobStatus;
|
||||
$status->job_name = 'Process Wallet Transaction';
|
||||
$status->complete = true;
|
||||
$status->save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -101,6 +101,11 @@ class SendEveMailJob implements ShouldQueue
|
||||
}
|
||||
|
||||
$this->delete();
|
||||
|
||||
$status = new JobStatus;
|
||||
$status->job_name = 'Send Eve Mail';
|
||||
$status->complete = true;
|
||||
$status->save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Jobs;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class JobError extends Model
|
||||
{
|
||||
//Table Name
|
||||
public $table = 'job_statuses';
|
||||
|
||||
//Timestamps
|
||||
public $timestaps = true;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'job_id',
|
||||
'job_name',
|
||||
'error',
|
||||
];
|
||||
|
||||
public function JobStatus() {
|
||||
$this->belongsTo('\App\Models\Jobs\JobStatus');
|
||||
}
|
||||
}
|
||||
@@ -18,12 +18,7 @@ class JobStatus extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'job_name',
|
||||
'complete',
|
||||
];
|
||||
|
||||
public function Error() {
|
||||
$this->hasOne('\App\Models\Jobs\JobError', 'job_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateJobStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!Schema::hasTable('job_status')) {
|
||||
Schema::create('job_status', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('job_name');
|
||||
$table->boolean('complete');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('job_status');
|
||||
}
|
||||
}
|
||||
2
vendor/composer/autoload_classmap.php
vendored
2
vendor/composer/autoload_classmap.php
vendored
@@ -41,7 +41,6 @@ return array(
|
||||
'App\\Http\\Middleware\\VerifyCsrfToken' => $baseDir . '/app/Http/Middleware/VerifyCsrfToken.php',
|
||||
'App\\Jobs\\ProcessWalletJournalJob' => $baseDir . '/app/Jobs/ProcessWalletJournalJob.php',
|
||||
'App\\Jobs\\ProcessWalletTransactionJob' => $baseDir . '/app/Jobs/ProcessWalletTransactionJob.php',
|
||||
'App\\Jobs\\SendEveMail' => $baseDir . '/app/Jobs/SendEveMail.php',
|
||||
'App\\Jobs\\SendEveMailJob' => $baseDir . '/app/Jobs/SendEveMailJob.php',
|
||||
'App\\Library\\Esi\\Esi' => $baseDir . '/app/Library/Esi/Esi.php',
|
||||
'App\\Library\\Esi\\Mail' => $baseDir . '/app/Library/Esi/Mail.php',
|
||||
@@ -88,6 +87,7 @@ return array(
|
||||
'App\\Models\\Jobs\\JobProcessWalletJournal' => $baseDir . '/app/Models/Jobs/JobProcessWalletJournal.php',
|
||||
'App\\Models\\Jobs\\JobProcessWalletTransaction' => $baseDir . '/app/Models/Jobs/JobProcessWalletTransaction.php',
|
||||
'App\\Models\\Jobs\\JobSendEveMail' => $baseDir . '/app/Models/Jobs/JobSendEveMail.php',
|
||||
'App\\Models\\Jobs\\JobStatus' => $baseDir . '/app/Models/Jobs/JobStatus.php',
|
||||
'App\\Models\\Lookups\\CharacterToCorporation' => $baseDir . '/app/Models/Lookups/CharacterToCorporation.php',
|
||||
'App\\Models\\Lookups\\CorporationToAlliance' => $baseDir . '/app/Models/Lookups/CorporationToAlliance.php',
|
||||
'App\\Models\\Lookups\\UserToCorporation' => $baseDir . '/app/Models/Lookups/UserToCorporation.php',
|
||||
|
||||
2
vendor/composer/autoload_static.php
vendored
2
vendor/composer/autoload_static.php
vendored
@@ -495,7 +495,6 @@ class ComposerStaticInitc3f953f8a7291d41a76e1664339777c9
|
||||
'App\\Http\\Middleware\\VerifyCsrfToken' => __DIR__ . '/../..' . '/app/Http/Middleware/VerifyCsrfToken.php',
|
||||
'App\\Jobs\\ProcessWalletJournalJob' => __DIR__ . '/../..' . '/app/Jobs/ProcessWalletJournalJob.php',
|
||||
'App\\Jobs\\ProcessWalletTransactionJob' => __DIR__ . '/../..' . '/app/Jobs/ProcessWalletTransactionJob.php',
|
||||
'App\\Jobs\\SendEveMail' => __DIR__ . '/../..' . '/app/Jobs/SendEveMail.php',
|
||||
'App\\Jobs\\SendEveMailJob' => __DIR__ . '/../..' . '/app/Jobs/SendEveMailJob.php',
|
||||
'App\\Library\\Esi\\Esi' => __DIR__ . '/../..' . '/app/Library/Esi/Esi.php',
|
||||
'App\\Library\\Esi\\Mail' => __DIR__ . '/../..' . '/app/Library/Esi/Mail.php',
|
||||
@@ -542,6 +541,7 @@ class ComposerStaticInitc3f953f8a7291d41a76e1664339777c9
|
||||
'App\\Models\\Jobs\\JobProcessWalletJournal' => __DIR__ . '/../..' . '/app/Models/Jobs/JobProcessWalletJournal.php',
|
||||
'App\\Models\\Jobs\\JobProcessWalletTransaction' => __DIR__ . '/../..' . '/app/Models/Jobs/JobProcessWalletTransaction.php',
|
||||
'App\\Models\\Jobs\\JobSendEveMail' => __DIR__ . '/../..' . '/app/Models/Jobs/JobSendEveMail.php',
|
||||
'App\\Models\\Jobs\\JobStatus' => __DIR__ . '/../..' . '/app/Models/Jobs/JobStatus.php',
|
||||
'App\\Models\\Lookups\\CharacterToCorporation' => __DIR__ . '/../..' . '/app/Models/Lookups/CharacterToCorporation.php',
|
||||
'App\\Models\\Lookups\\CorporationToAlliance' => __DIR__ . '/../..' . '/app/Models/Lookups/CorporationToAlliance.php',
|
||||
'App\\Models\\Lookups\\UserToCorporation' => __DIR__ . '/../..' . '/app/Models/Lookups/UserToCorporation.php',
|
||||
|
||||
Reference in New Issue
Block a user