コード例 #1
0
 public PeriodicStatCollector(IDiscordClient client, IMetrics metrics, ILogger logger, WebhookCacheService webhookCache, DbConnectionCountHolder countHolder, IDataStore data)
 {
     _client       = (DiscordShardedClient)client;
     _metrics      = metrics;
     _webhookCache = webhookCache;
     _countHolder  = countHolder;
     _data         = data;
     _logger       = logger.ForContext <PeriodicStatCollector>();
 }
コード例 #2
0
ファイル: PKConnection.cs プロジェクト: xSke/PluralKit
 public PKConnection(NpgsqlConnection inner, DbConnectionCountHolder countHolder, ILogger logger,
                     IMetrics metrics)
 {
     Inner        = inner;
     ConnectionId = Guid.NewGuid();
     _countHolder = countHolder;
     _logger      = logger.ForContext <PKConnection>();
     _metrics     = metrics;
 }
コード例 #3
0
 public PeriodicStatCollector(DiscordShardedClient client, IMetrics metrics, ILogger logger, WebhookCacheService webhookCache, DbConnectionCountHolder countHolder, CpuStatService cpu, IDatabase db)
 {
     _client       = client;
     _metrics      = metrics;
     _webhookCache = webhookCache;
     _countHolder  = countHolder;
     _cpu          = cpu;
     _db           = db;
     _logger       = logger.ForContext <PeriodicStatCollector>();
 }
コード例 #4
0
 public PeriodicStatCollector(IMetrics metrics, ILogger logger, WebhookCacheService webhookCache, DbConnectionCountHolder countHolder, CpuStatService cpu, IDatabase db, IDiscordCache cache)
 {
     _metrics      = metrics;
     _webhookCache = webhookCache;
     _countHolder  = countHolder;
     _cpu          = cpu;
     _db           = db;
     _cache        = cache;
     _logger       = logger.ForContext <PeriodicStatCollector>();
 }
コード例 #5
0
 public PeriodicStatCollector(IDiscordClient client, IMetrics metrics, SystemStore systems, MemberStore members, SwitchStore switches, MessageStore messages, ILogger logger, WebhookCacheService webhookCache, DbConnectionCountHolder countHolder)
 {
     _client       = (DiscordShardedClient)client;
     _metrics      = metrics;
     _systems      = systems;
     _members      = members;
     _switches     = switches;
     _messages     = messages;
     _webhookCache = webhookCache;
     _countHolder  = countHolder;
     _logger       = logger.ForContext <PeriodicStatCollector>();
 }
コード例 #6
0
 public PeriodicStatCollector(IMetrics metrics, ILogger logger, WebhookCacheService webhookCache,
                              DbConnectionCountHolder countHolder, CpuStatService cpu, ModelRepository repo,
                              BotConfig botConfig, CoreConfig config, RedisService redis, IDiscordCache cache)
 {
     _metrics      = metrics;
     _webhookCache = webhookCache;
     _countHolder  = countHolder;
     _cpu          = cpu;
     _repo         = repo;
     _cache        = cache;
     _botConfig    = botConfig;
     _config       = config;
     _redis        = redis;
     _logger       = logger.ForContext <PeriodicStatCollector>();
 }
コード例 #7
0
    public Database(CoreConfig config, DbConnectionCountHolder countHolder, ILogger logger,
                    IMetrics metrics, DatabaseMigrator migrator)
    {
        _config      = config;
        _countHolder = countHolder;
        _metrics     = metrics;
        _migrator    = migrator;
        _logger      = logger.ForContext <Database>();

        _connectionString = new NpgsqlConnectionStringBuilder(_config.Database)
        {
            Pooling        = true,
            Enlist         = false,
            NoResetOnClose = true,

            // Lower timeout than default (15s -> 2s), should ideally fail-fast instead of hanging
            Timeout = 2
        }.ConnectionString;
    }