Rather embarrasing mistake in rewarderbot interval config param.

This commit is contained in:
benbierens 2024-04-01 15:55:47 +02:00
parent f5291517c1
commit 4cd22f3719
No known key found for this signature in database
GPG Key ID: 877D2C2E09A22F3A
5 changed files with 8 additions and 8 deletions

View File

@ -27,11 +27,11 @@
public class RewarderBotStartupConfig
{
public RewarderBotStartupConfig(string discordBotHost, int discordBotPort, string interval, DateTime historyStartUtc, DiscordBotGethInfo gethInfo, string? dataPath)
public RewarderBotStartupConfig(string discordBotHost, int discordBotPort, string intervalMinutes, DateTime historyStartUtc, DiscordBotGethInfo gethInfo, string? dataPath)
{
DiscordBotHost = discordBotHost;
DiscordBotPort = discordBotPort;
Interval = interval;
IntervalMinutes = intervalMinutes;
HistoryStartUtc = historyStartUtc;
GethInfo = gethInfo;
DataPath = dataPath;
@ -39,7 +39,7 @@
public string DiscordBotHost { get; }
public int DiscordBotPort { get; }
public string Interval { get; }
public string IntervalMinutes { get; }
public DateTime HistoryStartUtc { get; }
public DiscordBotGethInfo GethInfo { get; }
public string? DataPath { get; set; }

View File

@ -17,7 +17,7 @@ namespace CodexDiscordBotPlugin
AddEnvVar("DISCORDBOTHOST", config.DiscordBotHost);
AddEnvVar("DISCORDBOTPORT", config.DiscordBotPort.ToString());
AddEnvVar("INTERVALMINUTES", config.Interval);
AddEnvVar("INTERVALMINUTES", config.IntervalMinutes);
var offset = new DateTimeOffset(config.HistoryStartUtc);
AddEnvVar("CHECKHISTORY", offset.ToUnixTimeSeconds().ToString());

View File

@ -47,7 +47,7 @@ namespace CodexTests.BasicTests
//discordBotPort: botContainer.GetAddress(GetTestLog(), DiscordBotContainerRecipe.RewardsPort).Port,
discordBotHost: botContainer.GetInternalAddress(DiscordBotContainerRecipe.RewardsPort).Host,
discordBotPort: botContainer.GetInternalAddress(DiscordBotContainerRecipe.RewardsPort).Port,
interval: "60",
intervalMinutes: "1",
historyStartUtc: GetTestRunTimeRange().From - TimeSpan.FromMinutes(3),
gethInfo: gethInfo,
dataPath: null

View File

@ -14,7 +14,7 @@ namespace TestNetRewarder
public int DiscordPort { get; set; } = 31080;
[Uniform("interval-minutes", "im", "INTERVALMINUTES", false, "time in minutes between reward updates. (default 15)")]
public int Interval { get; set; } = 15;
public int IntervalMinutes { get; set; } = 15;
[Uniform("check-history", "ch", "CHECKHISTORY", true, "Unix epoc timestamp of a moment in history on which processing begins. Required for hosting rewards. Should be 'launch of the testnet'.")]
public int CheckHistoryTimestamp { get; set; } = 0;

View File

@ -13,10 +13,10 @@ namespace TestNetRewarder
{
this.log = log;
if (configuration.Interval < 0) configuration.Interval = 15;
if (configuration.IntervalMinutes < 0) configuration.IntervalMinutes = 15;
if (configuration.CheckHistoryTimestamp == 0) throw new Exception("'check-history' unix timestamp is required. Set it to the start/launch moment of the testnet.");
segmentSize = TimeSpan.FromSeconds(configuration.Interval);
segmentSize = TimeSpan.FromMinutes(configuration.IntervalMinutes);
start = DateTimeOffset.FromUnixTimeSeconds(configuration.CheckHistoryTimestamp).UtcDateTime;
log.Log("Starting time segments at " + start);