// src/lib/redis.ts
// Copyright (C) 2026 Robert Colbert <rob.colbert@openplatform.us>
// All Rights Reserved

import env from "../config/env.js";
import { Redis } from "ioredis";

import { GadgetLog } from "@gadget/api";
const log = new GadgetLog({ name: "redis", slug: "redis" });

log.info("connecting to Redis", {
  host: env.redis.host,
  port: env.redis.port,
});

const redis = new Redis(env.redis);
redis.setMaxListeners(64);

export default redis;
