Files
gunshiz 5812d99715
CI / Verify (push) Successful in 2m30s
CI / Build immutable images and deploy (push) Successful in 3m9s
feat : comment feature
2026-10-08 01:40:08 +07:00

16 lines
468 B
TypeScript

import "server-only";
import { getRedisClient, redisEventChannel } from "@/lib/redis/client";
export async function notifyCommentChange(target: string) {
try {
const redis = await getRedisClient();
await Promise.all([
redis.publish(redisEventChannel(`comments:${target}`), "changed"),
redis.publish(redisEventChannel("comments:admin"), "changed"),
]);
} catch {
// A committed comment remains saved when Pub/Sub is unavailable.
}
}