diff --git a/src/Infrastructure/BotSharp.Abstraction/Repositories/BotSharpDatabaseSettings.cs b/src/Infrastructure/BotSharp.Abstraction/Repositories/BotSharpDatabaseSettings.cs index b3c26033..19f5b141 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Repositories/BotSharpDatabaseSettings.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Repositories/BotSharpDatabaseSettings.cs @@ -2,18 +2,19 @@ namespace BotSharp.Abstraction.Repositories; public class BotSharpDatabaseSettings : DatabaseBasicSettings { - public string[] Assemblies { get; set; } - public string FileRepository { get; set; } - public string BotSharpMongoDb { get; set; } - public string TablePrefix { get; set; } - public DbConnectionSetting BotSharp { get; set; } - public string Redis { get; set; } + public string[] Assemblies { get; set; } = []; + public string FileRepository { get; set; } = string.Empty; + public string BotSharpMongoDb { get; set; } = string.Empty; + public string TablePrefix { get; set; } = string.Empty; + public DbConnectionSetting BotSharp { get; set; } = new(); + public string Redis { get; set; } = string.Empty; + public bool EnableReplica { get; set; } = true; } public class DatabaseBasicSettings { - public string Default { get; set; } - public DbConnectionSetting DefaultConnection { get; set; } + public string Default { get; set; } = string.Empty; + public DbConnectionSetting DefaultConnection { get; set; } = new(); public bool EnableSqlLog { get; set; } public bool EnableSensitiveDataLogging { get; set; } public bool EnableRetryOnFailure { get; set; } @@ -23,9 +24,11 @@ public class DbConnectionSetting { public string Master { get; set; } public string[] Slavers { get; set; } + public int ConnectionTimeout { get; set; } = 30; + public int ExecutionTimeout { get; set; } = 30; public DbConnectionSetting() { - Slavers = new string[0]; + Slavers = []; } } \ No newline at end of file diff --git a/src/Infrastructure/BotSharp.Core/BotSharp.Core.csproj b/src/Infrastructure/BotSharp.Core/BotSharp.Core.csproj index 1c82c84f..1c9955aa 100644 --- a/src/Infrastructure/BotSharp.Core/BotSharp.Core.csproj +++ b/src/Infrastructure/BotSharp.Core/BotSharp.Core.csproj @@ -190,7 +190,7 @@ - + diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/BotSharp.Plugin.MongoStorage.csproj b/src/Plugins/BotSharp.Plugin.MongoStorage/BotSharp.Plugin.MongoStorage.csproj index ab14d864..dced7973 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/BotSharp.Plugin.MongoStorage.csproj +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/BotSharp.Plugin.MongoStorage.csproj @@ -11,8 +11,8 @@ - - + +