Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

Handle Redis client auto-parsing of job store items

Cursor Agent81b8d156c588
diff --git a/lib/redis-job-store.ts b/lib/redis-job-store.ts
index 595f134c..fe9345a0 100644
--- a/lib/redis-job-store.ts
+++ b/lib/redis-job-store.ts
@@ -158,7 +158,14 @@ export class RedisJobStore {
for (const item of items) {
try {
- const parsed = JSON.parse(item as string);
+ let parsed;
+ // Check if data is already an object (Redis client auto-parsed)
+ if (typeof item === "object" && item !== null) {
+ parsed = item as { blobUrl: string; jobId: string; scheduledAt: string };
+ } else {
+ // Otherwise parse the JSON string
+ parsed = JSON.parse(item as string);
+ }
blobs.push(parsed);
} catch (error) {
console.error("Error parsing cleanup item:", error);