init test

This commit is contained in:
2026-01-24 00:43:25 +08:00
parent 51aed643a0
commit 5657bffd39
22 changed files with 1182 additions and 18 deletions

22
convex/actions/redis.ts Normal file
View File

@@ -0,0 +1,22 @@
'use node';
import { query, mutation, action } from "../_generated/server";
import { Kevisual } from '@kevisual/ai/browser'
import { v } from "convex/values";
import { Redis } from "ioredis";
const redisClient = new Redis({
host: process.env.REDIS_HOST,
password: process.env.REDIS_PASSWORD,
});
let time: any = null;
export const isConnected = action({
args: {},
handler: async (ctx) => {
const result = await redisClient.ping();
if (time === null) {
time = new Date();
}
console.log("Redis PING at", new Date().toISOString(), "since", time);
return result === "PONG";
},
});