Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature | Use native Laravel retry logic when possible #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Models/WorkflowJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Artisan;
use Sassnowski\Venture\Exceptions\CannotRetryJobException;
use Sassnowski\Venture\Exceptions\JobAlreadyStartedException;
use Sassnowski\Venture\Serializer\WorkflowJobSerializer;
Expand Down Expand Up @@ -170,6 +172,20 @@
throw new CannotRetryJobException();
}

if (config('queue.failed.driver') == 'database-uuids') {
$job = DB::connection(config('queue.failed.database'))

Check failure on line 176 in src/Models/WorkflowJob.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable - ubuntu-latest

Parameter #1 $name of static method Illuminate\Database\DatabaseManager::connection() expects string|null, mixed given.

Check failure on line 176 in src/Models/WorkflowJob.php

View workflow job for this annotation

GitHub Actions / P8.3 - L10.* - prefer-stable - ubuntu-latest

Parameter #1 $name of static method Illuminate\Database\DatabaseManager::connection() expects string|null, mixed given.
->table(config('queue.failed.table'))

Check failure on line 177 in src/Models/WorkflowJob.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable - ubuntu-latest

Parameter #1 $table of method Illuminate\Database\Connection::table() expects Closure|Illuminate\Contracts\Database\Query\Expression|Illuminate\Database\Query\Builder|string, mixed given.

Check failure on line 177 in src/Models/WorkflowJob.php

View workflow job for this annotation

GitHub Actions / P8.3 - L10.* - prefer-stable - ubuntu-latest

Parameter #1 $table of method Illuminate\Database\Connection::table() expects Closure|Illuminate\Contracts\Database\Query\Expression|Illuminate\Database\Query\Builder|string, mixed given.
->select('uuid')
->where('payload', 'LIKE', "%{$this->uuid}%")
->first();
if ($job) {
Artisan::call('queue:retry', [
'id' => $job->uuid

Check failure on line 183 in src/Models/WorkflowJob.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable - ubuntu-latest

Access to an undefined property object::$uuid.

Check failure on line 183 in src/Models/WorkflowJob.php

View workflow job for this annotation

GitHub Actions / P8.3 - L10.* - prefer-stable - ubuntu-latest

Access to an undefined property object::$uuid.
]);
return;
}
}

\dispatch($this->step());
}

Expand Down
Loading