Remove all redis leftovers

This commit is contained in:
runebaas 2020-06-01 01:02:36 +02:00
parent 46fee88f03
commit 520633c590
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
8 changed files with 2 additions and 156 deletions

View file

@ -1,35 +0,0 @@
using System.Collections.Generic;
using Geekbot.net.Lib.Logger;
using StackExchange.Redis;
namespace Geekbot.net.Lib.AlmostRedis
{
// if anyone ever sees this, please come up with a better fucking name, i'd appriciate it
public class AlmostRedis : IAlmostRedis
{
private readonly GeekbotLogger _logger;
private readonly RunParameters _runParameters;
public AlmostRedis(GeekbotLogger logger, RunParameters runParameters)
{
_logger = logger;
_runParameters = runParameters;
}
public void Connect()
{
Connection = ConnectionMultiplexer.Connect($"{_runParameters.RedisHost}:{_runParameters.RedisPort}");
Db = Connection.GetDatabase(int.Parse(_runParameters.RedisDatabase));
_logger.Information(LogSource.Redis, $"Connected to Redis on {Connection.Configuration} at {Db.Database}");
}
public IDatabase Db { get; private set; }
public ConnectionMultiplexer Connection { get; private set; }
public IEnumerable<RedisKey> GetAllKeys()
{
return Connection.GetServer($"{_runParameters.RedisHost}:{_runParameters.RedisPort}").Keys(int.Parse(_runParameters.RedisDatabase));
}
}
}

View file

@ -1,13 +0,0 @@
using System.Collections.Generic;
using StackExchange.Redis;
namespace Geekbot.net.Lib.AlmostRedis
{
public interface IAlmostRedis
{
void Connect();
IDatabase Db { get; }
ConnectionMultiplexer Connection { get; }
IEnumerable<RedisKey> GetAllKeys();
}
}

View file

@ -10,7 +10,7 @@
TranslationsFailed = 201,
// Dependent Services
RedisConnectionFailed = 301,
/* 301 not in use anymore (redis) */
DatabaseConnectionFailed = 302,
// Discord Related

View file

@ -10,7 +10,6 @@ namespace Geekbot.net.Lib.Logger
Rest,
Gateway,
Discord,
Redis,
Database,
Message,
UserRepository,

View file

@ -50,19 +50,6 @@ namespace Geekbot.net.Lib
[Option("db-logging", Default = false, HelpText = "Enable database logging")]
public bool DbLogging { get; set; }
/************************************
* Redis *
************************************/
[Option("redis-host", Default = "127.0.0.1", HelpText = "Set a redis host")]
public string RedisHost { get; set; }
[Option("redis-port", Default = "6379", HelpText = "Set a redis port")]
public string RedisPort { get; set; }
[Option("redis-database", Default = "6", HelpText = "Select a redis database (1-15)")]
public string RedisDatabase { get; set; }
/************************************
* WebApi *
************************************/