Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repo sync #3984

Merged
merged 2 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions lib/redis-accessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ class RedisAccessor {
? new Redis(REDIS_URL, {
...redisBaseOptions,
db: databaseNumber,
tls: {
// Required for production Heroku Redis
rejectUnauthorized: false

// Only add this configuration for TLS-enabled REDIS_URL values.
// Otherwise, it breaks for local Redis instances without TLS enabled.
...REDIS_URL.startsWith('rediss://') && {
tls: {
// Required for production Heroku Redis
rejectUnauthorized: false
}
}
})
: new InMemoryRedis()
Expand Down
11 changes: 8 additions & 3 deletions middleware/rate-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ module.exports = rateLimit({
store: REDIS_URL && new RedisStore({
client: new Redis(REDIS_URL, {
db: rateLimitDatabaseNumber,
tls: {
// Required for production Heroku Redis
rejectUnauthorized: false

// Only add this configuration for TLS-enabled REDIS_URL values.
// Otherwise, it breaks for local Redis instances without TLS enabled.
...REDIS_URL.startsWith('rediss://') && {
tls: {
// Required for production Heroku Redis
rejectUnauthorized: false
}
}
}),
// 1 minute (or practically unlimited outside of production)
Expand Down
11 changes: 8 additions & 3 deletions script/purge-redis-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ purgeRenderedPageCache()
function purgeRenderedPageCache () {
const redisClient = new Redis(REDIS_URL, {
db: pageCacheDatabaseNumber,
tls: {
// Required for production Heroku Redis
rejectUnauthorized: false

// Only add this configuration for TLS-enabled REDIS_URL values.
// Otherwise, it breaks for local Redis instances without TLS enabled.
...REDIS_URL.startsWith('rediss://') && {
tls: {
// Required for production Heroku Redis
rejectUnauthorized: false
}
}
})
let totalKeyCount = 0
Expand Down