This commit is contained in:
2026-01-25 19:18:59 +08:00
parent fea68a736f
commit 7c28690eaa
17 changed files with 501 additions and 150 deletions

View File

@@ -1,22 +1,22 @@
'use node';
// '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";
},
});
// 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";
// },
// });