You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a Driver or Storage object without manually calling getRedisClient().
Attempt to call setItem or getItem.
Describe the bug
The Redis instance is initialized only when the getRedisClient() function is called. However, getRedisClient() is never invoked during the creation of the Driver or the Storage objects. As a result, the first call to getRedisClient() occurs only when setItem or getItem is called.
This causes an issue where the Redis instance is created and attempts to get or set an item, but the ioredis instance has not yet established a connection to the Redis server.
Expected Behavior
The Redis instance should be initialized and connected to the Redis server before any get or set operations are performed.
Actual Behavior
The Redis instance is created at the time of the first setItem or getItem call, and the ioredis instance is not yet connected.
Possible Solution
Ensure that the getRedisClient() function is called after beeing defined to establish a connection to the Redis server before any operations are performed.
From what I can see, it seems to be same for Mongodb
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Environment
Unstorage v1.10.2
Reproduction
Describe the bug
The Redis instance is initialized only when the
getRedisClient()
function is called. However,getRedisClient()
is never invoked during the creation of theDriver
or theStorage
objects. As a result, the first call togetRedisClient()
occurs only whensetItem
orgetItem
is called.This causes an issue where the Redis instance is created and attempts to get or set an item, but the
ioredis
instance has not yet established a connection to the Redis server.Expected Behavior
The Redis instance should be initialized and connected to the Redis server before any get or set operations are performed.
Actual Behavior
The Redis instance is created at the time of the first
setItem
orgetItem
call, and theioredis
instance is not yet connected.Possible Solution
Ensure that the
getRedisClient()
function is called after beeing defined to establish a connection to the Redis server before any operations are performed.From what I can see, it seems to be same for Mongodb
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: