Skip to content

Commit a2b4a5c

Browse files
authored
Merge pull request #65 from maarsson/feature/custom-queue
Make queue configurable
2 parents 983ed85 + 1f4fdb6 commit a2b4a5c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ return [
101101

102102
'queue' => [
103103
'enabled' => env('REQUEST_ANALYTICS_QUEUE_ENABLED', false),
104+
'on_queue' => env('REQUEST_ANALYTICS_ON_QUEUE', 'default'),
104105
],
105106

106107
'ignore-paths' => [
@@ -276,6 +277,7 @@ php artisan model:prune --model="MeShaon\RequestAnalytics\Models\RequestAnalytic
276277

277278
### Queue Processing
278279
- `queue.enabled`: Process analytics data in background jobs for better performance
280+
- `queue.on_queue`: Specifies the queue name for processing analytics jobs
279281

280282
### Path Filtering
281283
- `ignore-paths`: Array of paths to exclude from tracking (e.g., admin routes, health checks)

config/request-analytics.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
'queue' => [
3434
'enabled' => env('REQUEST_ANALYTICS_QUEUE_ENABLED', false),
35+
'on_queue' => env('REQUEST_ANALYTICS_ON_QUEUE', 'default'),
3536
],
3637

3738
'ignore-paths' => [

src/Jobs/ProcessData.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ class ProcessData implements ShouldQueue
1414
{
1515
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
1616

17-
public function __construct(public RequestDataDTO $requestDataDTO) {}
17+
public function __construct(public RequestDataDTO $requestDataDTO)
18+
{
19+
$this->onQueue((string) config('request-analytics.queue.on_queue'));
20+
}
1821

1922
public function handle(RequestAnalyticsService $requestAnalyticsService): void
2023
{

0 commit comments

Comments
 (0)