Skip to content

Commit

Permalink
[1.x] Add CacheInteractions ignore key for Vapor job attempts (#221)
Browse files Browse the repository at this point in the history
* Add CacheInteractions ignore key for Vapor job attempts

* internalize keys

* formatting

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
jbrooksuk and taylorotwell authored Dec 13, 2023
1 parent bfd305b commit ab51a86
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
8 changes: 2 additions & 6 deletions config/pulse.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Laravel\Pulse\Http\Middleware\Authorize;
use Laravel\Pulse\Pulse;
use Laravel\Pulse\Recorders;

return [
Expand Down Expand Up @@ -134,12 +135,7 @@
'enabled' => env('PULSE_CACHE_INTERACTIONS_ENABLED', true),
'sample_rate' => env('PULSE_CACHE_INTERACTIONS_SAMPLE_RATE', 1),
'ignore' => [
'/^laravel:pulse:/', // Internal Pulse keys...
'/^illuminate:/', // Internal Laravel keys...
'/^telescope:/', // Internal Telescope keys...
'/^nova/', // Internal Nova keys...
'/^.+@.+\|(?:(?:\d+\.\d+\.\d+\.\d+)|[0-9a-fA-F:]+)(?::timer)?$/', // Breeze / Jetstream authentication rate limiting...
'/^[a-zA-Z0-9]{40}$/', // Session IDs...
...Pulse::vendorCacheKeys(),
],
'groups' => [
'/^job-exceptions:.*/' => 'job-exceptions:*',
Expand Down
16 changes: 16 additions & 0 deletions src/Pulse.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,22 @@ public function js(): string
return "<script>{$content}</script>".PHP_EOL;
}

/**
* The default "vendor" cache keys that should be ignored by Pulse.
*/
public static function vendorCacheKeys(): array

Check failure on line 497 in src/Pulse.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Method Laravel\Pulse\Pulse::vendorCacheKeys() return type has no value type specified in iterable type array.
{
return [
'/(^laravel_vapor_job_attemp(t?)s:)/', // Laravel Vapor keys...
'/^.+@.+\|(?:(?:\d+\.\d+\.\d+\.\d+)|[0-9a-fA-F:]+)(?::timer)?$/', // Breeze / Jetstream keys...
'/^[a-zA-Z0-9]{40}$/', // Session IDs...
'/^illuminate:/', // Laravel keys...
'/^laravel:pulse:/', // Pulse keys...
'/^nova/', // Nova keys...
'/^telescope:/', // Telescope keys...
];
}

/**
* Determine if Pulse may register routes.
*/
Expand Down

0 comments on commit ab51a86

Please sign in to comment.