Commit f5a35d27 authored by Dillenn Terumalai's avatar Dillenn Terumalai
Browse files

// WIP

parent d01fc73d
......@@ -17,15 +17,16 @@ return [
/*
|--------------------------------------------------------------------------
| Horizon Database Connection
| Horizon Route Middleware
|--------------------------------------------------------------------------
|
| This is the name of the SQL connection where Laravel Cluster will store the
| meta information required for it to function.
| These middleware will get attached onto each Horizon route, giving you
| the chance to add your own middleware to this list or change any of
| the existing middleware. Or, you can simply stick with this list.
|
*/
'use' => 'default',
'middleware' => ['web'],
/*
|--------------------------------------------------------------------------
......@@ -66,7 +67,7 @@ return [
|--------------------------------------------------------------------------
*/
'default_name' => 'default',
'name' => 'default',
/*
|--------------------------------------------------------------------------
......@@ -74,7 +75,7 @@ return [
|--------------------------------------------------------------------------
*/
'default_partition' => 'normal',
'partition' => 'normal',
/*
|--------------------------------------------------------------------------
......
......@@ -2,18 +2,36 @@
namespace Dterumal\LaravelCluster\Database\Factories;
use Carbon\Carbon;
use Dterumal\LaravelCluster\Storage\JobModel;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
class ModelFactory extends Factory
class JobModelFactory extends Factory
{
protected $model = YourModel::class;
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = JobModel::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'id' => $this->faker->numerify('#####'),
'job_name' => 'default',
'partition' => 'normal',
'payload' => serialize('random string'),
'job' => serialize('random string'),
'std_out_path' => '/path/to/std/out',
'std_err_path' => '/path/to/std/err',
'export_path' => null,
'queued_at' => Carbon::now()
];
}
}
*/
......@@ -3,6 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Carbon;
class CreateClusterJobsTable extends Migration
{
......@@ -23,7 +24,7 @@ class CreateClusterJobsTable extends Migration
$table->text('std_err_path');
$table->text('export_path')->nullable();
$table->unsignedTinyInteger('attempts');
$table->dateTime('queued_at')->default('NOW');
$table->dateTime('queued_at');
$table->dateTime('cancelled_at')->nullable();
$table->dateTime('failed_at')->nullable();
$table->dateTime('completed_at')->nullable();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment