mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-13 21:32:28 +00:00
Abstract config design and update logging format (#624)
* Abstract config design and update logging pattern Also drops legacy config support * Fix unit tests * Make backup of config file when upgrading * Use shared process semaphore to fix migration race conditions * Use mutex because semaphore isn't supported * Make startup wait for configs to load * Move mutex to config load instead of constructor * Add debug logging * Make mutex static * Change mutex name format * Make mutex use global namespace * Remove debug logging and fix config upgrading * Rename lambda variable
This commit is contained in:
parent
7179574e43
commit
c86d2a11b5
9 changed files with 310 additions and 443 deletions
|
@ -10,13 +10,10 @@ public sealed class DatabaseFactAttribute : FactAttribute
|
|||
|
||||
public DatabaseFactAttribute()
|
||||
{
|
||||
ServerConfiguration.Instance = new ServerConfiguration
|
||||
{
|
||||
DbConnectionString = "server=127.0.0.1;uid=root;pwd=lighthouse;database=lighthouse",
|
||||
};
|
||||
ServerConfiguration.Instance.DbConnectionString = "server=127.0.0.1;uid=root;pwd=lighthouse;database=lighthouse";
|
||||
if (!ServerStatics.DbConnected) this.Skip = "Database not available";
|
||||
else
|
||||
lock(migrateLock)
|
||||
lock (migrateLock)
|
||||
{
|
||||
using Database database = new();
|
||||
database.Database.Migrate();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue