Skip to content

Commit

Permalink
Use L1 replica tier
Browse files Browse the repository at this point in the history
  • Loading branch information
nicknotfun committed Aug 11, 2023
1 parent 021d5f5 commit dc56006
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/server/shared/redis/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ export const BASE_REDIS_OPTIONS: RedisOptions = {
connectTimeout: 15_000,
};

const READONLY_REDIS_OPTIONS: RedisOptions = {
...BASE_REDIS_OPTIONS,
readOnly: true,
};

// The main global of instance we have.
const K8_PRIMARY_REDIS: RedisConnectionSpec = {
kind: "tcp",
Expand All @@ -81,6 +86,12 @@ const K8_PRIMARY_REDIS: RedisConnectionSpec = {
options: BASE_REDIS_OPTIONS,
};

const K8_L1_REDIS: RedisConnectionSpec = {
kind: "k8",
service: "redis-l1",
options: READONLY_REDIS_OPTIONS,
};

const K8_OTHER_REDIS: RedisConnectionSpec = {
kind: "tcp",
host: "redis-other",
Expand Down Expand Up @@ -263,6 +274,7 @@ export interface RedisSchema {
const PROD_RC_REDIS: RedisSchema = {
db: 0,
conn: K8_PRIMARY_REDIS,
replica: K8_L1_REDIS,
};

export const REDIS_SCHEMA = {
Expand Down

0 comments on commit dc56006

Please sign in to comment.