Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
⬆️ Install Laravel Horizon
  • Loading branch information
lorisleiva committed Oct 2, 2018
1 parent 5a42e4e commit 31d4139
Show file tree
Hide file tree
Showing 12 changed files with 337 additions and 1 deletion.
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -9,6 +9,7 @@
"fideloper/proxy": "^4.0",
"google/apiclient": "^2.2",
"laravel/framework": "5.6.*",
"laravel/horizon": "^1.4",
"laravel/tinker": "^1.0",
"ramsey/uuid": "^3.8"
},
Expand Down
177 changes: 176 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 94 additions & 0 deletions config/horizon.php
@@ -0,0 +1,94 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Horizon Redis Connection
|--------------------------------------------------------------------------
|
| This is the name of the Redis connection where Horizon will store the
| meta information required for it to function. It includes the list
| of supervisors, failed jobs, job metrics, and other information.
|
*/

'use' => 'default',

/*
|--------------------------------------------------------------------------
| Horizon Redis Prefix
|--------------------------------------------------------------------------
|
| This prefix will be used when storing all Horizon data in Redis. You
| may modify the prefix when you are running multiple installations
| of Horizon on the same server so that they don't have problems.
|
*/

'prefix' => env('HORIZON_PREFIX', 'horizon:'),

/*
|--------------------------------------------------------------------------
| Queue Wait Time Thresholds
|--------------------------------------------------------------------------
|
| This option allows you to configure when the LongWaitDetected event
| will be fired. Every connection / queue combination may have its
| own, unique threshold (in seconds) before this event is fired.
|
*/

'waits' => [
'redis:default' => 60,
],

/*
|--------------------------------------------------------------------------
| Job Trimming Times
|--------------------------------------------------------------------------
|
| Here you can configure for how long (in minutes) you desire Horizon to
| persist the recent and failed jobs. Typically, recent jobs are kept
| for one hour while all failed jobs are stored for an entire week.
|
*/

'trim' => [
'recent' => 60,
'failed' => 10080,
],

/*
|--------------------------------------------------------------------------
| Queue Worker Configuration
|--------------------------------------------------------------------------
|
| Here you may define the queue worker settings used by your application
| in all environments. These supervisors and settings handle all your
| queued jobs and will be provisioned by Horizon during deployment.
|
*/

'environments' => [
'production' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['default'],
'balance' => 'simple',
'processes' => 10,
'tries' => 3,
],
],

'local' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['default'],
'balance' => 'simple',
'processes' => 3,
'tries' => 3,
],
],
],
];
35 changes: 35 additions & 0 deletions database/migrations/2018_10_02_143729_create_failed_jobs_table.php
@@ -0,0 +1,35 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('failed_jobs');
}
}
7 changes: 7 additions & 0 deletions public/vendor/horizon/css/app.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/vendor/horizon/css/app.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added public/vendor/horizon/img/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions public/vendor/horizon/img/horizon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/vendor/horizon/img/sprite.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions public/vendor/horizon/js/app.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/vendor/horizon/js/app.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions public/vendor/horizon/mix-manifest.json
@@ -0,0 +1,6 @@
{
"/js/app.js": "/js/app.js?id=abd95663ce821390d4fa",
"/css/app.css": "/css/app.css?id=5ce9973b1bc9f6a46cb2",
"/js/app.js.map": "/js/app.js.map?id=125981781d35176ff5f1",
"/css/app.css.map": "/css/app.css.map?id=5d0439ebaab1434c7ea0"
}

0 comments on commit 31d4139

Please sign in to comment.