22 lines
555 B
JavaScript
22 lines
555 B
JavaScript
const cl = global.botanLoader;
|
|
const Dragonfly = global.Dragonfly;
|
|
|
|
const Redis = require( "redis" );
|
|
|
|
const SessConf = cl.load( "config.all" ).sx.modular.session;
|
|
|
|
var Client = Redis.createClient({
|
|
"legacyMode": true
|
|
, "url": `redis://${SessConf.config.host}:${SessConf.config.port}/${SessConf.config.database}`
|
|
});
|
|
|
|
Client.addListener( "error", ( e ) => { throw e; } );
|
|
|
|
Client.select( SessConf.config.database, function( err, message )
|
|
{
|
|
if( err ) throw err;
|
|
Dragonfly.Info( "[Session] Database connected. Ready." );
|
|
});
|
|
|
|
module.exports = Client;
|