1
0
Fork 0
mirror of synced 2024-07-20 21:55:54 +12:00

Fix types

This commit is contained in:
Adria Navarro 2023-09-19 13:27:42 +02:00
parent 1d63b219b8
commit e128f1c921
2 changed files with 3 additions and 3 deletions

View file

@ -120,7 +120,7 @@ export async function getUsers(
): Promise<{ users: User[]; notFoundIds?: string[] }> {
const client = await redis.getUserClient()
// try cache
let usersFromCache = await client.bulkGet<User>(userIds)
let usersFromCache = await client.bulkGet(userIds)
const missingUsersFromCache = userIds.filter(uid => !usersFromCache[uid])
const users = Object.values(usersFromCache)
let notFoundIds

View file

@ -242,7 +242,7 @@ class RedisWrapper {
}
}
async bulkGet<T>(keys: string[]) {
async bulkGet(keys: string[]) {
const db = this._db
if (keys.length === 0) {
return {}
@ -250,7 +250,7 @@ class RedisWrapper {
const prefixedKeys = keys.map(key => addDbPrefix(db, key))
let response = await this.getClient().mget(prefixedKeys)
if (Array.isArray(response)) {
let final: any = {}
let final: Record<string, any> = {}
let count = 0
for (let result of response) {
if (result) {