Esempio n. 1
0
 public PKConnection(NpgsqlConnection inner, DbConnectionCountHolder countHolder, ILogger logger, IMetrics metrics)
 {
     Inner        = inner;
     ConnectionId = Guid.NewGuid();
     _countHolder = countHolder;
     _logger      = logger.ForContext <PKConnection>();
     _metrics     = metrics;
 }
Esempio n. 2
0
 public Database(CoreConfig config, DbConnectionCountHolder countHolder, ILogger logger,
                 IMetrics metrics)
 {
     _config      = config;
     _countHolder = countHolder;
     _metrics     = metrics;
     _logger      = logger;
 }
Esempio n. 3
0
        public Database(CoreConfig config, DbConnectionCountHolder countHolder, ILogger logger,
                        IMetrics metrics)
        {
            _config      = config;
            _countHolder = countHolder;
            _metrics     = metrics;
            _logger      = logger;

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

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