refactor(server): make redis required module (#9121)

This commit is contained in:
forehalo
2024-12-13 06:27:15 +00:00
parent 81c68032e1
commit 0e73737407
40 changed files with 292 additions and 728 deletions

View File

@@ -29,11 +29,11 @@ AFFiNE.ENV_MAP = {
COPILOT_OPENAI_API_KEY: 'plugins.copilot.openai.apiKey',
COPILOT_FAL_API_KEY: 'plugins.copilot.fal.apiKey',
COPILOT_UNSPLASH_API_KEY: 'plugins.copilot.unsplashKey',
REDIS_SERVER_HOST: 'plugins.redis.host',
REDIS_SERVER_PORT: ['plugins.redis.port', 'int'],
REDIS_SERVER_USER: 'plugins.redis.username',
REDIS_SERVER_PASSWORD: 'plugins.redis.password',
REDIS_SERVER_DATABASE: ['plugins.redis.db', 'int'],
REDIS_SERVER_HOST: 'redis.host',
REDIS_SERVER_PORT: ['redis.port', 'int'],
REDIS_SERVER_USER: 'redis.username',
REDIS_SERVER_PASSWORD: 'redis.password',
REDIS_SERVER_DATABASE: ['redis.db', 'int'],
DOC_MERGE_INTERVAL: ['doc.manager.updatePollInterval', 'int'],
STRIPE_API_KEY: 'plugins.payment.stripe.keys.APIKey',
STRIPE_WEBHOOK_KEY: 'plugins.payment.stripe.keys.webhookKey',

View File

@@ -58,13 +58,6 @@ AFFiNE.use('copilot', {
apiKey: '',
},
});
AFFiNE.use('redis', {
host: env.REDIS_SERVER_HOST,
db: 0,
port: 6379,
username: env.REDIS_SERVER_USER,
password: env.REDIS_SERVER_PASSWORD,
});
AFFiNE.use('payment', {
stripe: {
keys: {

View File

@@ -71,14 +71,6 @@ AFFiNE.server.port = 3010;
// ## Plugins settings ##
// ###############################################################
//
// /* Redis Plugin */
// /* Provide caching and session storing backed by Redis. */
// /* Useful when you deploy AFFiNE server in a cluster. */
// AFFiNE.use('redis', {
// /* override options */
// });
//
//
// /* Payment Plugin */
// AFFiNE.use('payment', {
// stripe: { keys: {}, apiVersion: '2023-10-16' },