Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/gitpod-db/src/redis/client.ts
2500 views
1
/**
2
* Copyright (c) 2023 Gitpod GmbH. All rights reserved.
3
* Licensed under the GNU Affero General Public License (AGPL).
4
* See License.AGPL.txt in the project root for license information.
5
*/
6
7
import { Redis } from "ioredis";
8
9
export function newRedisClient(opts: {
10
host: string;
11
port: number;
12
connectionName: string;
13
username?: string | undefined;
14
password?: string | undefined;
15
}): Redis {
16
return new Redis({
17
port: opts.port,
18
host: opts.host,
19
enableReadyCheck: true,
20
keepAlive: 10 * 1000,
21
connectionName: opts.connectionName,
22
username: opts.username,
23
password: opts.password,
24
});
25
}
26
27