2021-07-19 15:57:50 +02:00
|
|
|
import { RedisVariablesRepository } from "./RedisVariablesRepository";
|
|
|
|
import { redisClient } from "../RedisClient";
|
|
|
|
import { VoidVariablesRepository } from "./VoidVariablesRepository";
|
|
|
|
import { VariablesRepositoryInterface } from "./VariablesRepositoryInterface";
|
|
|
|
|
|
|
|
let variablesRepository: VariablesRepositoryInterface;
|
|
|
|
if (!redisClient) {
|
2021-11-24 16:20:07 +01:00
|
|
|
console.warn("WARNING: Redis isnot configured. No variables will be persisted.");
|
2021-07-19 15:57:50 +02:00
|
|
|
variablesRepository = new VoidVariablesRepository();
|
|
|
|
} else {
|
|
|
|
variablesRepository = new RedisVariablesRepository(redisClient);
|
|
|
|
}
|
|
|
|
|
|
|
|
export { variablesRepository };
|