mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-12 06:27:10 +03:00
test fixes
test fixes - fix timeout in redis (by @ajayyy) - allow "errors" in tempVIP test - remove duplicate warning in postSkipSegments - remove duplicate VIP in tempVIP - run tests against different user once tempVIP removed - fix typo in getHashCache fetching syntax and wording - use standard syntax in redisTest - fix spacing in getLockReason - typo in npm script name test cases - add getHashCache test case - add more tests to redisTest configuration - update config to use redis timeout - update docker-compose to use newest pinned version Co-Authored-By: Ajay Ramachandran <dev@ajay.app>
This commit is contained in:
@@ -33,7 +33,7 @@ if (config.redis?.enabled) {
|
||||
|
||||
const get = client.get.bind(client);
|
||||
exportClient.get = (key) => new Promise((resolve, reject) => {
|
||||
const timeout = setTimeout(() => reject(), config.redis.getTimeout);
|
||||
const timeout = config.redis.getTimeout ? setTimeout(() => reject(), config.redis.getTimeout) : null;
|
||||
get(key).then((reply) => {
|
||||
clearTimeout(timeout);
|
||||
resolve(reply);
|
||||
@@ -48,7 +48,10 @@ if (config.redis?.enabled) {
|
||||
.catch((err) => reject(err))
|
||||
);
|
||||
client.on("error", function(error) {
|
||||
Logger.error(error);
|
||||
Logger.error(`Redis Error: ${error}`);
|
||||
});
|
||||
client.on("reconnect", () => {
|
||||
Logger.info("Redis: trying to reconnect");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user