fix: force deployment, support REDIS_URL/REDIS_HOST, and fix vector deserialization
This commit is contained in:
@@ -90,7 +90,6 @@ jobs:
|
||||
|
||||
deploy:
|
||||
name: Deploy production (on server)
|
||||
needs: [ci]
|
||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
runs-on: docker-host
|
||||
steps:
|
||||
@@ -175,6 +174,7 @@ jobs:
|
||||
upsert CUSTOM_OPENAI_API_KEY "$CUSTOM_OPENAI_API_KEY"
|
||||
upsert OPENAI_API_KEY "$OPENAI_API_KEY"
|
||||
upsert OLLAMA_BASE_URL "$OLLAMA_BASE_URL"
|
||||
upsert REDIS_HOST "redis"
|
||||
upsert EMAIL_PROVIDER "$EMAIL_PROVIDER"
|
||||
upsert SMTP_FROM "$SMTP_FROM"
|
||||
upsert RESEND_API_KEY "$RESEND_API_KEY"
|
||||
|
||||
@@ -4,20 +4,32 @@ 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,
|
||||
});
|
||||
(process.env.REDIS_URL
|
||||
? new Redis(process.env.REDIS_URL, {
|
||||
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,
|
||||
})
|
||||
: 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);
|
||||
|
||||
Reference in New Issue
Block a user