add pass redis test
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m6s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m6s
This commit is contained in:
parent
7b37cc37db
commit
2f7ec40e78
8 changed files with 23 additions and 5 deletions
|
|
@ -128,6 +128,7 @@ export class AuthRoleController extends Controller {
|
||||||
redisClient = await this.redis.createClient({
|
redisClient = await this.redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
|
|
||||||
redisClient.del("role_" + posMaster.current_holderId, (err: Error) => {
|
redisClient.del("role_" + posMaster.current_holderId, (err: Error) => {
|
||||||
|
|
@ -296,6 +297,7 @@ export class AuthRoleController extends Controller {
|
||||||
redisClient = await this.redis.createClient({
|
redisClient = await this.redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
|
|
||||||
await redisClient.flushdb(function (err: any, succeeded: any) {
|
await redisClient.flushdb(function (err: any, succeeded: any) {
|
||||||
|
|
|
||||||
|
|
@ -8830,6 +8830,7 @@ export class OrganizationController extends Controller {
|
||||||
const redisClient = redis.createClient({
|
const redisClient = redis.createClient({
|
||||||
host: process.env.REDIS_HOST || "localhost",
|
host: process.env.REDIS_HOST || "localhost",
|
||||||
port: parseInt(process.env.REDIS_PORT || "6379"),
|
port: parseInt(process.env.REDIS_PORT || "6379"),
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
const keysAsync = promisify(redisClient.keys).bind(redisClient);
|
const keysAsync = promisify(redisClient.keys).bind(redisClient);
|
||||||
const delAsync = promisify(redisClient.del).bind(redisClient);
|
const delAsync = promisify(redisClient.del).bind(redisClient);
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ export class PermissionController extends Controller {
|
||||||
redisClient = await this.redis.createClient({
|
redisClient = await this.redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
const getAsync = promisify(redisClient.get).bind(redisClient);
|
const getAsync = promisify(redisClient.get).bind(redisClient);
|
||||||
|
|
||||||
|
|
@ -293,6 +294,7 @@ export class PermissionController extends Controller {
|
||||||
redisClient = await this.redis.createClient({
|
redisClient = await this.redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
const getAsync = promisify(redisClient.get).bind(redisClient);
|
const getAsync = promisify(redisClient.get).bind(redisClient);
|
||||||
|
|
||||||
|
|
@ -691,6 +693,7 @@ export class PermissionController extends Controller {
|
||||||
redisClient = await this.redis.createClient({
|
redisClient = await this.redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
const getAsync = promisify(redisClient.get).bind(redisClient);
|
const getAsync = promisify(redisClient.get).bind(redisClient);
|
||||||
|
|
||||||
|
|
@ -807,6 +810,7 @@ export class PermissionController extends Controller {
|
||||||
redisClient = await this.redis.createClient({
|
redisClient = await this.redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
const getAsync = promisify(redisClient.get).bind(redisClient);
|
const getAsync = promisify(redisClient.get).bind(redisClient);
|
||||||
|
|
||||||
|
|
@ -902,6 +906,7 @@ export class PermissionController extends Controller {
|
||||||
redisClient = await this.redis.createClient({
|
redisClient = await this.redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
const getAsync = promisify(redisClient.get).bind(redisClient);
|
const getAsync = promisify(redisClient.get).bind(redisClient);
|
||||||
|
|
||||||
|
|
@ -1155,6 +1160,7 @@ export class PermissionController extends Controller {
|
||||||
redisClient = await this.redis.createClient({
|
redisClient = await this.redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
const getAsync = promisify(redisClient.get).bind(redisClient);
|
const getAsync = promisify(redisClient.get).bind(redisClient);
|
||||||
|
|
||||||
|
|
@ -1413,6 +1419,7 @@ export class PermissionController extends Controller {
|
||||||
redisClient = await this.redis.createClient({
|
redisClient = await this.redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
// const getAsync = promisify(redisClient.get).bind(redisClient);
|
// const getAsync = promisify(redisClient.get).bind(redisClient);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -328,6 +328,7 @@ export class PosMasterActController extends Controller {
|
||||||
const redisClient = await this.redis.createClient({
|
const redisClient = await this.redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
|
|
||||||
const delAsync = promisify(redisClient.del).bind(redisClient);
|
const delAsync = promisify(redisClient.del).bind(redisClient);
|
||||||
|
|
@ -865,6 +866,7 @@ export class PosMasterActController extends Controller {
|
||||||
const redisClient = await this.redis.createClient({
|
const redisClient = await this.redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
|
|
||||||
const delAsync = promisify(redisClient.del).bind(redisClient);
|
const delAsync = promisify(redisClient.del).bind(redisClient);
|
||||||
|
|
|
||||||
|
|
@ -384,6 +384,7 @@ class Extension {
|
||||||
const redisClient = redis.createClient({
|
const redisClient = redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
const delAsync = promisify(redisClient.del).bind(redisClient);
|
const delAsync = promisify(redisClient.del).bind(redisClient);
|
||||||
const deleteKey = delAsync(type + id);
|
const deleteKey = delAsync(type + id);
|
||||||
|
|
|
||||||
|
|
@ -217,17 +217,20 @@ class CheckAuth {
|
||||||
|
|
||||||
// Create Redis client
|
// Create Redis client
|
||||||
const redisClient = this.redis.createClient({
|
const redisClient = this.redis.createClient({
|
||||||
socket: {
|
// socket: {
|
||||||
|
// host: REDIS_HOST,
|
||||||
|
// port: REDIS_PORT,
|
||||||
|
// },
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
},
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
|
|
||||||
redisClient.on("error", (err: any) => {
|
redisClient.on("error", (err: any) => {
|
||||||
console.error("[REDIS] Connection error:", err.message);
|
console.error("[REDIS] Connection error:", err.message);
|
||||||
});
|
});
|
||||||
|
|
||||||
await redisClient.connect();
|
// await redisClient.connect();
|
||||||
console.log("[REDIS] Connected successfully!");
|
console.log("[REDIS] Connected successfully!");
|
||||||
|
|
||||||
const getAsync = promisify(redisClient.get).bind(redisClient);
|
const getAsync = promisify(redisClient.get).bind(redisClient);
|
||||||
|
|
|
||||||
|
|
@ -844,6 +844,7 @@ export class ExecuteOrgCommandService {
|
||||||
const redisClient = await redis.createClient({
|
const redisClient = await redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
|
|
||||||
const delAsync = promisify(redisClient.del).bind(redisClient);
|
const delAsync = promisify(redisClient.del).bind(redisClient);
|
||||||
|
|
|
||||||
|
|
@ -1987,6 +1987,7 @@ async function clearMenuAndRoleCache(): Promise<void> {
|
||||||
const redisClient = redis.createClient({
|
const redisClient = redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
password: process.env.REDIS_PASSWORD,
|
||||||
});
|
});
|
||||||
|
|
||||||
const keysAsync = promisify(redisClient.keys).bind(redisClient);
|
const keysAsync = promisify(redisClient.keys).bind(redisClient);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue