Skip to content

Commit

Permalink
Made Changes as per comment
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyvishal committed Apr 9, 2024
1 parent e28f188 commit 16a24f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 34 deletions.
4 changes: 2 additions & 2 deletions controllers/Bot.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import ActionsService from '../services/Actions.js'
import AI from '../services/AI.js'
import logger from '../utils/logger.js'
import {db} from '../server.js'
import DBService from '../services/DBService.js'
import { v4 as uuidv4 } from 'uuid'
import MapsService from '../services/MapService.js'
import get_text_by_key from '../utils/language.js'
const mapService = new MapsService()

const db = new DBService()
const actionsService = new ActionsService()

/**
Expand Down
33 changes: 1 addition & 32 deletions services/DBService.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,38 +149,7 @@ class DBService {

return sessions;
}
async set_data(key, data) {
let response = {
status: false,
}
try {
await this.redisClient.set(key, JSON.stringify(data))
response.status = true
response.message = 'Data set successfully!'
} catch (err) {
logger.error(err)
response.error = err
}

logger.info(response)
return response
}
async get_data(key) {
let response = {
status: false,
}
try {
const data = await this.redisClient.get(key)
response.status = true
response.message = 'Data fetched successfully!';
response.data = JSON.parse(data)
} catch (err) {
logger.error(err)
response.error = err
}

logger.info(response)
return response}

}

export default DBService;

0 comments on commit 16a24f4

Please sign in to comment.