Replaced redis with Valkey (#3164)

### What problem does this PR solve?

Replaced redis with Valkey. Close #3070

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [x] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
This commit is contained in:
Zhichang Yu
2024-11-02 20:05:12 +08:00
committed by GitHub
parent 44ad9a6cd7
commit 37d71dfa90
4 changed files with 593 additions and 574 deletions

View File

@ -1,6 +1,6 @@
import json
import redis
import valkey as redis
import logging
from rag import settings
from rag.utils import singleton
@ -40,7 +40,7 @@ class RedisDB:
db=int(self.config.get("db", 1)),
password=self.config.get("password"),
decode_responses=True)
except Exception as e:
except Exception:
logging.warning("Redis can't be connected.")
return self.REDIS