File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Generic ;
3
3
using System . IO ;
4
- using System . Threading ;
5
4
using Microsoft . Extensions . Configuration ;
6
5
7
6
using MySql . Data . MySqlClient ;
@@ -20,22 +19,12 @@ public static class AppConfig
20
19
21
20
public static string CertsPath => Path . GetFullPath ( Config . GetValue < string > ( "Data:CertificatesPath" ) ) ;
22
21
23
- private static int _configFirst ;
24
-
25
22
private static IConfiguration ConfigBuilder { get ; } = new ConfigurationBuilder ( )
26
23
. AddInMemoryCollection ( DefaultConfig )
27
24
. AddJsonFile ( "config.json" )
28
25
. Build ( ) ;
29
26
30
- public static IConfiguration Config
31
- {
32
- get
33
- {
34
- if ( Interlocked . Exchange ( ref _configFirst , 1 ) == 0 )
35
- Console . WriteLine ( "Config Read" ) ;
36
- return ConfigBuilder ;
37
- }
38
- }
27
+ public static IConfiguration Config => ConfigBuilder ;
39
28
40
29
public static string ConnectionString => Config . GetValue < string > ( "Data:ConnectionString" ) ;
41
30
@@ -64,6 +53,6 @@ public static MySqlConnectionStringBuilder CreateSha256ConnectionStringBuilder()
64
53
}
65
54
66
55
// tests can run much slower in CI environments
67
- public static int TimeoutDelayFactor { get ; } = ( Environment . GetEnvironmentVariable ( "APPVEYOR" ) == "True" || Environment . GetEnvironmentVariable ( "TRAVIS" ) == "true" ) ? 6 : 1 ;
56
+ public static int TimeoutDelayFactor { get ; } = Environment . GetEnvironmentVariable ( "APPVEYOR" ) == "True" || Environment . GetEnvironmentVariable ( "TRAVIS" ) == "true" ? 6 : 1 ;
68
57
}
69
58
}
You can’t perform that action at this time.
0 commit comments