@@ -34,15 +34,15 @@ discard block |
||
34 | 34 | |
35 | 35 | $this->app->singleton(StoreResolver::class); |
36 | 36 | |
37 | - $this->app->singleton('heavy-jobs-store', function (Application $app) { |
|
37 | + $this->app->singleton('heavy-jobs-store', function(Application $app) { |
|
38 | 38 | return $app->make(PayloadStoreManager::class); |
39 | 39 | }); |
40 | 40 | |
41 | - $this->app->extend(QueueFactory::class, function (QueueManager $manager, Application $app) { |
|
41 | + $this->app->extend(QueueFactory::class, function(QueueManager $manager, Application $app) { |
|
42 | 42 | return new QueueManagerDecorator($manager, $app); |
43 | 43 | }); |
44 | 44 | |
45 | - $this->app->extend(FailedJobProviderInterface::class, function (FailedJobProviderInterface $provider) { |
|
45 | + $this->app->extend(FailedJobProviderInterface::class, function(FailedJobProviderInterface $provider) { |
|
46 | 46 | return new FailedJobProviderDecorator($provider); |
47 | 47 | }); |
48 | 48 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | private function registerPayloadCleaner(): void |
53 | 53 | { |
54 | - Queue::createPayloadUsing(function ($connection, $queue, $payload) { |
|
54 | + Queue::createPayloadUsing(function($connection, $queue, $payload) { |
|
55 | 55 | $job = Arr::get($payload, 'data.command'); |
56 | 56 | if ($job instanceof HeavyJob) { |
57 | 57 | return ['heavy-payload-id' => $job->getHeavyPayloadId()]; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | return []; |
61 | 61 | }); |
62 | 62 | |
63 | - $this->app['events']->listen(JobProcessed::class, function (JobProcessed $event): void { |
|
63 | + $this->app['events']->listen(JobProcessed::class, function(JobProcessed $event): void { |
|
64 | 64 | if ($heavyPayloadId = Arr::get($event->job->payload(), 'heavy-payload-id')) { |
65 | 65 | HeavyJobsStore::remove($heavyPayloadId); |
66 | 66 | } |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | { |
29 | 29 | $score = $this->lifetime !== -1 ? Carbon::now()->getTimestamp() : 0; |
30 | 30 | |
31 | - [$payload, $ids] = $this->connection->pipeline(function ($pipe) use ($id, $score): void { |
|
31 | + [$payload, $ids] = $this->connection->pipeline(function($pipe) use ($id, $score): void { |
|
32 | 32 | $pipe->eval(LuaScripts::get(), [self::JOB_PAYLOADS_KEY, self::FAILED_JOB_PAYLOADS_KEY, $id], 2); |
33 | 33 | $pipe->zrangebyscore(self::LIFETIME_FAILED_JOB_PAYLOADS_KEY, '-inf', (string) $score); |
34 | 34 | }); |
35 | 35 | |
36 | 36 | if (count($ids)) { |
37 | - $this->connection->pipeline(function ($pipe) use ($ids, $score): void { |
|
37 | + $this->connection->pipeline(function($pipe) use ($ids, $score): void { |
|
38 | 38 | $pipe->hdel(self::FAILED_JOB_PAYLOADS_KEY, ...$ids); |
39 | 39 | $pipe->zremrangebyscore(self::LIFETIME_FAILED_JOB_PAYLOADS_KEY, '-inf', (string) $score); |
40 | 40 | }); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | public function set(string $id, string $serializedData): bool |
52 | 52 | { |
53 | - [$set] = $this->connection->pipeline(function ($pipe) use ($id, $serializedData): void { |
|
53 | + [$set] = $this->connection->pipeline(function($pipe) use ($id, $serializedData): void { |
|
54 | 54 | $pipe->hset(self::JOB_PAYLOADS_KEY, $id, $serializedData); |
55 | 55 | $pipe->zrem(self::LIFETIME_FAILED_JOB_PAYLOADS_KEY, $id); |
56 | 56 | }); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | public function removeFailed(string $id): bool |
72 | 72 | { |
73 | - [$deleted] = $this->connection->pipeline(function ($pipe) use ($id): void { |
|
73 | + [$deleted] = $this->connection->pipeline(function($pipe) use ($id): void { |
|
74 | 74 | $pipe->hdel(self::FAILED_JOB_PAYLOADS_KEY, $id); |
75 | 75 | $pipe->zrem(self::LIFETIME_FAILED_JOB_PAYLOADS_KEY, $id); |
76 | 76 | }); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | public function markAsFailed(string $id): bool |
82 | 82 | { |
83 | - [$marked] = $this->connection->pipeline(function ($pipe) use ($id): void { |
|
83 | + [$marked] = $this->connection->pipeline(function($pipe) use ($id): void { |
|
84 | 84 | $pipe->eval(LuaScripts::markAsFailed(), [self::JOB_PAYLOADS_KEY, self::FAILED_JOB_PAYLOADS_KEY, $id], 2); |
85 | 85 | $pipe->zadd(self::LIFETIME_FAILED_JOB_PAYLOADS_KEY, Carbon::now()->getTimestamp() + $this->lifetime, $id); |
86 | 86 | }); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | public function flushFailed(): bool |
92 | 92 | { |
93 | - $result = $this->connection->pipeline(function ($pipe): void { |
|
93 | + $result = $this->connection->pipeline(function($pipe): void { |
|
94 | 94 | $pipe->del(self::FAILED_JOB_PAYLOADS_KEY); |
95 | 95 | $pipe->del(self::LIFETIME_FAILED_JOB_PAYLOADS_KEY); |
96 | 96 | }); |
@@ -138,7 +138,7 @@ |
||
138 | 138 | |
139 | 139 | private function prepareJobs($jobs): array |
140 | 140 | { |
141 | - return array_map(function ($job) { |
|
141 | + return array_map(function($job) { |
|
142 | 142 | return $this->prepareJob($job); |
143 | 143 | }, $jobs); |
144 | 144 | } |