All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 12s
- Sidebar: dynamic brand-accent colors, brainstorm section restyled - AI chat general: popup panel with expand/collapse, hides when contextual AI open - AI chat contextual: tabs reordered (Actions first), X close button, height fix - Settings: all tabs restyled, 6 new color presets (sage, terracotta, iron, etc.) - Global color cleanup: emerald/orange hardcoded → brand-accent dynamic - Brainstorm page: orange → brand-accent throughout - PageEntry animation component added to key pages - Floating AI button: bg-brand-accent instead of hardcoded black - i18n: all 15 locales updated with new AI/billing keys - Billing: freemium quota tracking, BYOK, stripe subscription scaffolding - Admin: integrated into new design - AGENTS.md + CLAUDE.md project rules added
33 lines
814 B
TypeScript
33 lines
814 B
TypeScript
import Redis from 'ioredis';
|
|
|
|
const globalForRedis = globalThis as unknown as { redis?: Redis };
|
|
|
|
const redis =
|
|
globalForRedis.redis ??
|
|
new Redis({
|
|
host: process.env.REDIS_HOST ?? 'localhost',
|
|
port: parseInt(process.env.REDIS_PORT ?? '6379'),
|
|
password: process.env.REDIS_PASSWORD,
|
|
lazyConnect: true,
|
|
retryStrategy(times) {
|
|
if (times > 10) {
|
|
console.error('[redis] Max retries exceeded, will retry in 30s');
|
|
return 30000;
|
|
}
|
|
return Math.min(times * 200, 2000);
|
|
},
|
|
maxRetriesPerRequest: 3,
|
|
});
|
|
|
|
redis.on('error', (err) => {
|
|
console.error('[redis] Connection error:', err.message);
|
|
});
|
|
|
|
redis.on('connect', () => {
|
|
console.log('[redis] Connected');
|
|
});
|
|
|
|
if (process.env.NODE_ENV !== 'production') globalForRedis.redis = redis;
|
|
|
|
export { redis };
|