Skip to content

Commit

Permalink
Merge pull request #107 from moisish/throttling-notifications-per-cha…
Browse files Browse the repository at this point in the history
…nnel

Failed Notification Cache Per Channel
  • Loading branch information
freekmurze committed Jul 29, 2022
2 parents a114243 + 9767b8e commit 0d2ebcc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Checks/Checks/ScheduleCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class ScheduleCheck extends Check
{
protected string $cacheKey = 'health.checks.schedule.latestHeartbeatAt';
protected string $cacheKey = 'health:checks:schedule:latestHeartbeatAt';

protected ?string $cacheStoreName = null;

Expand Down
2 changes: 1 addition & 1 deletion src/Notifications/CheckFailedNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function shouldSend(Notifiable $notifiable, string $channel): bool
return true;
}

$cacheKey = 'health.latestNotificationSentAt';
$cacheKey = 'health:latestNotificationSentAt:'.$channel;

/** @var \Illuminate\Cache\CacheManager $cache */
$cache = app('cache');
Expand Down
2 changes: 1 addition & 1 deletion src/ResultStores/CacheHealthResultStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CacheHealthResultStore implements ResultStore
{
public function __construct(
public string $store = 'file',
public string $cacheKey = 'healthStoreResults',
public string $cacheKey = 'health:storeResults',
) {
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ResultStores/CacheHealthResultStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
it('can cache check results', function () {
artisan(RunHealthChecksCommand::class)->assertSuccessful();

$json = cache()->store('file')->get('healthStoreResults');
$json = cache()->store('file')->get('health:storeResults');

assertMatchesJsonSnapshot($json);
});
Expand Down

0 comments on commit 0d2ebcc

Please sign in to comment.