Skip to content

Commit

Permalink
Avoid app helper, use Container singleton to resolve instead
Browse files Browse the repository at this point in the history
  • Loading branch information
paras-malhotra committed Oct 14, 2020
1 parent ec31e6d commit 2a587e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Queue/Middleware/PreventOverlappingJobs.php
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Queue\Middleware;

use Illuminate\Container\Container;
use Illuminate\Contracts\Cache\Repository as Cache;

class PreventOverlappingJobs
Expand Down Expand Up @@ -59,7 +60,8 @@ public function __construct($key = '', $releaseAfter = 0, $expiresAt = 0)
*/
public function handle($job, $next)
{
$lock = app(Cache::class)->lock($this->getLockKey($job), $this->expiresAt);
$lock = Container::getInstance()->make(Cache::class)
->lock($this->getLockKey($job), $this->expiresAt);

if ($lock->get()) {
try {
Expand Down

0 comments on commit 2a587e5

Please sign in to comment.