Allowed database queue usage where desired

This commit is contained in:
Dan Brown 2021-12-13 18:34:18 +00:00
parent f27d0d5aeb
commit d00ac3101d
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
5 changed files with 75 additions and 4 deletions

View File

@ -100,8 +100,7 @@ MEMCACHED_SERVERS=127.0.0.1:11211:100
REDIS_SERVERS=127.0.0.1:6379:0 REDIS_SERVERS=127.0.0.1:6379:0
# Queue driver to use # Queue driver to use
# Queue not really currently used but may be configurable in the future. # Can be 'sync', 'database' or 'redis'
# Would advise not to change this for now.
QUEUE_CONNECTION=sync QUEUE_CONNECTION=sync
# Storage system to use # Storage system to use

View File

@ -11,7 +11,7 @@
return [ return [
// Default driver to use for the queue // Default driver to use for the queue
// Options: null, sync, redis // Options: sync, database, redis
'default' => env('QUEUE_CONNECTION', 'sync'), 'default' => env('QUEUE_CONNECTION', 'sync'),
// Queue connection configuration // Queue connection configuration

View File

@ -67,7 +67,7 @@ class MaintenanceController extends Controller
$this->logActivity(ActivityType::MAINTENANCE_ACTION_RUN, 'send-test-email'); $this->logActivity(ActivityType::MAINTENANCE_ACTION_RUN, 'send-test-email');
try { try {
user()->notify(new TestEmail()); user()->notifyNow(new TestEmail());
$this->showSuccessNotification(trans('settings.maint_send_test_email_success', ['address' => user()->email])); $this->showSuccessNotification(trans('settings.maint_send_test_email_success', ['address' => user()->email]));
} catch (\Exception $exception) { } catch (\Exception $exception) {
$errorMessage = trans('errors.maintenance_test_email_failure') . "\n" . $exception->getMessage(); $errorMessage = trans('errors.maintenance_test_email_failure') . "\n" . $exception->getMessage();

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$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');
}
}