Framework: Kann die Laravel5.1-Warteschlange nicht erneut versuchen?

Erstellt am 14. Jan. 2016  ·  3Kommentare  ·  Quelle: laravel/framework

Ich verwende die Laravel-Warteschlange und während der Job fehlgeschlagen ist, wird es erneut versucht. Kann es nicht erneut versucht werden?

Alle 3 Kommentare

Jawohl.

wie macht man...

Wie kann man dafür sorgen, dass die Laravel-Warteschlange nicht erneut versucht?

    /**
     * Mark the given job as failed if it has exceeded the maximum allowed attempts.
     *
     * This will likely be because the job previously exceeded a timeout.
     *
     * <strong i="6">@param</strong>  string  $connectionName
     * <strong i="7">@param</strong>  \Illuminate\Contracts\Queue\Job  $job
     * <strong i="8">@param</strong>  int  $maxTries
     * <strong i="9">@return</strong> void
     */
    protected function markJobAsFailedIfAlreadyExceedsMaxAttempts($connectionName, $job, $maxTries)
    {
        if ($maxTries === 0 || $job->attempts() <= $maxTries) {
            return;
        }

        $e = new MaxAttemptsExceededException(
            'A queued job has been attempted too many times. The job may have previously timed out.'
        );

        $this->failJob($connectionName, $job, $e);

        throw $e;
    }

if ($maxTries === 0 || $job->attempts() <= $maxTries) bedeutet weder 0 noch 1 für --tries param kann dies tun.

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen

Verwandte Themen

Fuzzyma picture Fuzzyma  ·  3Kommentare

SachinAgarwal1337 picture SachinAgarwal1337  ·  3Kommentare

progmars picture progmars  ·  3Kommentare

PhiloNL picture PhiloNL  ·  3Kommentare

shopblocks picture shopblocks  ·  3Kommentare