From 33cabff3591c7f2e3d2c9965d2f6fee7911fbc90 Mon Sep 17 00:00:00 2001 From: Ske Date: Mon, 3 May 2021 10:34:53 +0200 Subject: [PATCH] Clean up autoproxy timeout command code Signed-off-by: Ske --- PluralKit.Bot/Commands/Autoproxy.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PluralKit.Bot/Commands/Autoproxy.cs b/PluralKit.Bot/Commands/Autoproxy.cs index a24b81d2..7b9adf48 100644 --- a/PluralKit.Bot/Commands/Autoproxy.cs +++ b/PluralKit.Bot/Commands/Autoproxy.cs @@ -160,8 +160,7 @@ namespace PluralKit.Bot var timeoutStr = ctx.RemainderOrNull(); var timeoutPeriod = DateUtils.ParsePeriod(timeoutStr); if (timeoutPeriod == null) throw new PKError($"Could not parse '{timeoutStr}' as a valid duration. Try using a syntax such as \"3h5m\" (i.e. 3 hours and 5 minutes)."); - Console.WriteLine(timeoutPeriod.Value.TotalHours); - if (timeoutPeriod.Value.TotalHours > (ulong)100000) + if (timeoutPeriod.Value.TotalHours > 100000) { // sanity check to prevent seconds overflow if someone types in 999999999 overflow = timeoutPeriod.Value; @@ -170,7 +169,6 @@ namespace PluralKit.Bot else newTimeout = timeoutPeriod; } - var timeoutSeconds = newTimeout.HasValue ? newTimeout?.TotalSeconds : -1; await _db.Execute(conn => _repo.UpdateSystem(conn, ctx.System.Id, new SystemPatch { LatchTimeout = (int?) newTimeout?.TotalSeconds }));