mirror of
https://github.com/ld3z/new-manga.git
synced 2026-11-09 20:43:45 -07:00
Fix errors maybe?
This commit is contained in:
parent
22c3e665e8
commit
66e9dd2a06
3 changed files with 21 additions and 4 deletions
|
|
@ -9,4 +9,9 @@ export default defineConfig({
|
||||||
remotePatterns: [{ protocol: "https" }],
|
remotePatterns: [{ protocol: "https" }],
|
||||||
},
|
},
|
||||||
integrations: [tailwind()],
|
integrations: [tailwind()],
|
||||||
|
vite: {
|
||||||
|
define: {
|
||||||
|
'process.env.REDIS_URL': JSON.stringify(process.env.REDIS_URL)
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -294,7 +294,8 @@ export async function getChaptersForSlugs(
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add progress tracking
|
// Add progress tracking
|
||||||
console.log(`Cache hits: ${cachedChapters.length} chapters from ${slugs.length - slugsToFetch.length} comics`);
|
const cachedSlugs = new Set(cachedChapters.map(c => c.md_comics.slug));
|
||||||
|
console.log(`Cache hits: ${cachedChapters.length} chapters from ${cachedSlugs.size} comics`);
|
||||||
console.log(`Fetching ${slugsToFetch.length} comics from API`);
|
console.log(`Fetching ${slugsToFetch.length} comics from API`);
|
||||||
|
|
||||||
const fetchPromises = slugsToFetch.map(async (slug) => {
|
const fetchPromises = slugsToFetch.map(async (slug) => {
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ async function createRedisClient(): Promise<Redis> {
|
||||||
console.log(`Redis retry attempt ${times}, next try in ${delay}ms`);
|
console.log(`Redis retry attempt ${times}, next try in ${delay}ms`);
|
||||||
return delay + Math.random() * 200; // Add jitter
|
return delay + Math.random() * 200; // Add jitter
|
||||||
},
|
},
|
||||||
maxRetriesPerRequest: 1,
|
maxRetriesPerRequest: null, // Allow retries for queued commands
|
||||||
enableOfflineQueue: false,
|
enableOfflineQueue: true, // Enable command queuing
|
||||||
enableReadyCheck: true,
|
enableReadyCheck: true,
|
||||||
reconnectOnError: (err) => {
|
reconnectOnError: (err) => {
|
||||||
return err.message.includes('READONLY');
|
return err.message.includes('READONLY');
|
||||||
|
|
@ -149,4 +149,15 @@ export async function getFeedMapping(feedId: string): Promise<FeedMapping | null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// No need for manual cleanup as we're using TTL (expire)
|
// No need for manual cleanup as we're using TTL (expire)
|
||||||
|
|
||||||
|
// Warm connection on startup
|
||||||
|
(async () => {
|
||||||
|
try {
|
||||||
|
const client = await getRedisClient();
|
||||||
|
await client.ping();
|
||||||
|
console.log('Redis pre-connected successfully');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Redis pre-connection failed:', error);
|
||||||
|
}
|
||||||
|
})();
|
||||||
Loading…
Add table
Add a link
Reference in a new issue