From b38f03c0e7218762d90fa5092696b127f24f36db Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 25 Jan 2026 07:07:26 +0000
Subject: [PATCH] =Some logical flaws in Queue.php, Queue.js, ContentExecutor.php, UploadExecutor.php - particularly with timeline ordering, frontend queue updates, etc

---
 inc/managers/queue/Storage.php |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/inc/managers/queue/Storage.php b/inc/managers/queue/Storage.php
index 2aa9ab6..0075d3a 100644
--- a/inc/managers/queue/Storage.php
+++ b/inc/managers/queue/Storage.php
@@ -4,15 +4,14 @@
 	exit;
 }
 
-use JVBase\managers\CacheManager;
+use JVBase\managers\Cache;
 
 class Storage
 {
 	private \wpdb $wpdb;
 	private string $table;
-	private CacheManager $cache;
+	private Cache $cache;
 
-	private const CACHE_USER_PREFIX = 'user_queue_';
 	private const CACHE_QUEUE_INFO = 'queue_info';
 
 	public function __construct()
@@ -20,7 +19,7 @@
 		global $wpdb;
 		$this->wpdb = $wpdb;
 		$this->table = $wpdb->prefix . BASE . '_operation_queue';
-		$this->cache = CacheManager::for('queue', DAY_IN_SECONDS);
+		$this->cache = Cache::for('queue', DAY_IN_SECONDS);
 	}
 
 	public function hasProcessingOperations(): bool
@@ -360,13 +359,11 @@
 
 	public function invalidateQueueCache(): void
 	{
-		$this->cache->delete(self::CACHE_QUEUE_INFO);
-		$this->cache->touch();
+		$this->cache->forget(self::CACHE_QUEUE_INFO);
 	}
 
 	private function invalidateUser(int $userId): void
 	{
-		CacheManager::invalidateAll("user_{$userId}");
-		$this->cache->delete(self::CACHE_QUEUE_INFO);
+		$this->cache->forget($userId);
 	}
 }

--
Gitblit v1.10.0