Reset Discord state if now > updated + timeout
Correctly reset Discord state only if now > updated + timeout instead of updated > start + timeout. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -153,7 +153,7 @@ class DiscordState
|
|||||||
void checkForTimeout()
|
void checkForTimeout()
|
||||||
{
|
{
|
||||||
final Duration actionTimeout = Duration.ofMinutes(config.actionTimeout());
|
final Duration actionTimeout = Duration.ofMinutes(config.actionTimeout());
|
||||||
events.removeIf(event -> event.getType().isShouldTimeout() &&
|
final Instant now = Instant.now();
|
||||||
event.getUpdated().isAfter(event.getStart().plus(actionTimeout)));
|
events.removeIf(event -> event.getType().isShouldTimeout() && now.isAfter(event.getUpdated().plus(actionTimeout)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user