Skip to content

Commit

Permalink
try config reflection hack
Browse files Browse the repository at this point in the history
  • Loading branch information
robot committed Sep 7, 2023
1 parent 35967ca commit 9a615f8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion slo/src/Cli/CliCommands.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Security.Cryptography.X509Certificates;
using System.Reflection;
using System.Text.RegularExpressions;
using Prometheus;
using slo.Jobs;
using Ydb.Sdk;
Expand All @@ -16,6 +17,12 @@ internal static async Task Create(CreateConfig createConfig)
createConfig.Db
);

var fieldInfo = config
.GetType()
.GetRuntimeFields()
.FirstOrDefault(fi => Regex.IsMatch(fi.Name, "\\AEndpointDiscoveryTimeout\\Z"));
fieldInfo?.SetValue(config, TimeSpan.FromMinutes(1));

await using var driver = await Driver.CreateInitialized(config);

using var tableClient = new TableClient(driver);
Expand Down

0 comments on commit 9a615f8

Please sign in to comment.