Remove unused redis config and do not control redis connection in intent.controller

This commit is contained in:
Apher 2026-07-18 00:25:59 +00:00
parent fec97eb018
commit 04684bba48
2 changed files with 0 additions and 12 deletions

View File

@ -1,4 +0,0 @@
module.exports = {
REDIS_HOST: process.env.REDIS_HOST,
REDIS_PORT: process.env.REDIS_PORT
}

View File

@ -45,8 +45,6 @@ exports.getIntentCommand = async (req, res) => {
console.log(`\n[Backend Intents] Processing intent.`);
await redis.client.connect().catch(console.error)
const intent = await Intent.findOne({ where: { description: req.body.text } });
if (intent) {
@ -61,8 +59,6 @@ exports.getIntentCommand = async (req, res) => {
}
);
await redis.client.quit();
console.log(`Intent matched and published to stream: ${commandId}`);
return res.json({
@ -82,8 +78,6 @@ exports.getIntentCommand = async (req, res) => {
}
);
await redis.client.quit();
console.log(`No intent match, error published: ${errorId}`);
return res.status(400).json({
@ -95,8 +89,6 @@ exports.getIntentCommand = async (req, res) => {
});
}
} catch (err) {
await redis.client.quit();
console.error("getIntentCommand error:", err);
return res.status(500).send({message: err.message || "Internal server error."});