Skip to content

Commit eca81ed

Browse files
committed
delete redis connection check
1 parent 80d4073 commit eca81ed

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

app/routes/_index.tsx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,11 @@
1-
import { drizzle as drizzleNeon } from "drizzle-orm/neon-http";
2-
import { drizzle as drizzlePg } from "drizzle-orm/node-postgres";
3-
import type { c } from "node_modules/better-auth/dist/shared/better-auth.C9FmyZ5W.cjs";
41
import { Link, useNavigate } from "react-router";
52
import { authClient } from "~/lib/auth-client";
6-
import { getRedisClient } from "~/lib/redis";
7-
import type { Route } from "./+types/_index";
8-
9-
export async function loader({ context }: Route.LoaderArgs) {
10-
const { env } = context.cloudflare;
11-
const db =
12-
env.NODE_ENV === "development"
13-
? drizzlePg(env.DATABASE_URL)
14-
: drizzleNeon(env.DATABASE_URL);
15-
const redisClient = getRedisClient(env);
16-
redisClient.on("error", (err) => console.log("Redis Client Error", err));
17-
await redisClient.connect();
18-
await redisClient.set("key", "value");
19-
const value = await redisClient.get("key");
20-
console.log(value);
21-
}
223

234
export default function Page() {
245
const navigate = useNavigate();
256
const anonymousLoginAndStart = async () => {
267
const user = await authClient.getSession();
27-
if (!user) {
8+
if (!user.data) {
289
const _user = await authClient.signIn.anonymous();
2910
}
3011
navigate("/play");

0 commit comments

Comments
 (0)