Skip to content

Commit

Permalink
Put queue suffix into own function. Able to
Browse files Browse the repository at this point in the history
deal with .fifo
  • Loading branch information
ArronKing committed Nov 5, 2021
1 parent b72bfa5 commit 3282651
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Illuminate/Queue/SqsQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,24 @@ public function getQueue($queue)
$queue = $queue ?: $this->default;

return filter_var($queue, FILTER_VALIDATE_URL) === false
? rtrim($this->prefix, '/').'/'.Str::finish($queue, $this->suffix)
? $this->suffixQueue($queue, $this->suffix)
: $queue;
}

/**
* Suffixes a queue
*
* @param string $queue
* @param string $suffix
* @return string
*/
private function suffixQueue($queue, $suffix = '')
{
$fifo = Str::endsWith($queue, '.fifo') ? '.fifo' : '';
$queue = rtrim($queue, '.fifo');
return rtrim($this->prefix, '/') . '/' . Str::finish($queue, $suffix) . $fifo;
}

/**
* Get the underlying SQS instance.
*
Expand Down

0 comments on commit 3282651

Please sign in to comment.