mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
logging DB used
This commit is contained in:
parent
6b7cc77667
commit
171065f45c
1 changed files with 8 additions and 1 deletions
|
@ -58,9 +58,16 @@ namespace BTCPayServer.Configuration
|
|||
|
||||
ApplicationDbContextFactory dbContext = null;
|
||||
if(opts.PostgresConnectionString == null)
|
||||
dbContext = new ApplicationDbContextFactory(DatabaseType.Sqlite, "Data Source=" + Path.Combine(opts.DataDir, "sqllite.db"));
|
||||
{
|
||||
var connStr = "Data Source=" + Path.Combine(opts.DataDir, "sqllite.db");
|
||||
Logs.Configuration.LogInformation($"SQLite DB used ({connStr})");
|
||||
dbContext = new ApplicationDbContextFactory(DatabaseType.Sqlite, connStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logs.Configuration.LogInformation($"Postgres DB used ({opts.PostgresConnectionString})");
|
||||
dbContext = new ApplicationDbContextFactory(DatabaseType.Postgres, opts.PostgresConnectionString);
|
||||
}
|
||||
DBFactory = dbContext;
|
||||
InvoiceRepository = new InvoiceRepository(dbContext, db, Network);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue