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