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/OperationQueue.php |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/inc/managers/OperationQueue.php b/inc/managers/OperationQueue.php
index cf6f398..b4e3c9c 100644
--- a/inc/managers/OperationQueue.php
+++ b/inc/managers/OperationQueue.php
@@ -79,7 +79,7 @@
     {
 		global $wpdb;
 		$this->wpdb = $wpdb;
-		$this->cache = new CacheManager('queue');
+		$this->cache = CacheManager::for('queue', DAY_IN_SECONDS);
         add_action('jvb_process_queue', [ $this, 'checkQueue' ]);
 		add_action('jvb_queue_maintenance', [$this, 'hourlyMaintenance']);
         add_action('jvbEmailDailyMetricsReport', [$this, 'emailDailyMetricsReport']);
@@ -579,7 +579,7 @@
 
 			$this->updateLastModified($user_id);
 			$this->invalidateQueueCache();
-			$this->cache->invalidate(self::CACHE_USER_QUEUE_PREFIX . $user_id);
+			$this->cache->delete(self::CACHE_USER_QUEUE_PREFIX . $user_id);
 			$this->runQueueOnShutdown();
 
 			return [
@@ -814,8 +814,8 @@
 				$this->processOperation($operation);
 
 				// Invalidate operation cache after processing
-				$this->cache->invalidate(self::CACHE_OPERATION_PREFIX . $operation->id);
-				$this->cache->invalidate(self::CACHE_USER_QUEUE_PREFIX . $operation->user_id);
+				$this->cache->delete(self::CACHE_OPERATION_PREFIX . $operation->id);
+				$this->cache->delete(self::CACHE_USER_QUEUE_PREFIX . $operation->user_id);
 			}
 
 			// Batch invalidate caches at the end
@@ -1025,13 +1025,12 @@
 		$keys = $cacheKeys[$scope] ?? $cacheKeys['all'];
 
 		foreach ($keys as $key) {
-			$this->cache->invalidate($key);
+			$this->cache->delete($key);
 		}
 
 		if ($scope === 'all') {
 			// Clear entire group for complete refresh
-			$this->cache->invalidateGroup($this->cacheGroup);
-			jvbUpdateCacheTimestamp('queue');
+			$this->cache->invalidate();
 			delete_transient('jvb_queue_status_counts');
 		}
 	}
@@ -1406,7 +1405,7 @@
 				}
 			}
 			// Clear operation cache after any update
-			$this->cache->invalidate(self::CACHE_OPERATION_PREFIX . $operation->id);
+			$this->cache->delete(self::CACHE_OPERATION_PREFIX . $operation->id);
 			$this->updateLastModified($operation->user_id);
 			return $filterResult;
 

--
Gitblit v1.10.0