From 42fa8304ddb811b0f725f245130f70c0f5e86a6c Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 04 Nov 2025 06:12:02 +0000
Subject: [PATCH] =Refactored LoginManager to be more extensible and configurable, as well as an AjaxRateLimiter
---
inc/managers/NotificationManager.php | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/inc/managers/NotificationManager.php b/inc/managers/NotificationManager.php
index 146d2a0..abac97a 100644
--- a/inc/managers/NotificationManager.php
+++ b/inc/managers/NotificationManager.php
@@ -139,7 +139,7 @@
*/
public function __construct()
{
- $this->cache = new CacheManager('notifications', WEEK_IN_SECONDS); // 1 week cache
+ $this->cache = CacheManager::for('notifications', WEEK_IN_SECONDS);
// Add filter for bulk operation handling
add_filter(BASE . 'handle_bulk_operation', [ $this, 'processOperation' ], 10, 3);
@@ -1095,7 +1095,7 @@
}
$content = '';
- $cache = new CacheManager('digest_content', HOUR_IN_SECONDS * 6); // Cache for 6 hours
+ $cache = CacheManager::for('digest_content', HOUR_IN_SECONDS * 6); // Cache for 6 hours
// Group updates by artist
$updates_by_artist = [];
@@ -1630,8 +1630,9 @@
*/
protected function clearNotificationCache(int $user_id):void
{
- $this->cache->invalidate("user_{$user_id}_notifications_", 'notifications_' . $user_id);
- $this->cache->invalidate("user_{$user_id}_content_notifications_", 'notifications_' . $user_id);
+
+ $this->cache->delete("user_{$user_id}_notifications_", 'notifications_' . $user_id);
+ $this->cache->delete("user_{$user_id}_content_notifications_", 'notifications_' . $user_id);
}
/**
--
Gitblit v1.10.0