migrate to typescript

This commit is contained in:
Dainius Daukševičius
2020-10-17 21:56:54 +03:00
committed by Dainius Dauksevicius
parent c462323dd5
commit 08d27265fc
120 changed files with 5002 additions and 4711 deletions

19
src/utils/redis.ts Normal file
View File

@@ -0,0 +1,19 @@
import {config} from '../config';
import {Logger} from './logger';
import redis, {Callback} from 'redis';
let get, set;
if (config.redis) {
Logger.info('Connected to redis');
const client = redis.createClient(config.redis);
get = client.get;
set = client.set;
} else {
get = (key: string, callback?: Callback<string | null>) => callback(null, undefined);
set = (key: string, value: string, callback?: Callback<string | null>) => callback(null, undefined);
}
export {
get,
set,
};