aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-04-16 02:34:51 +1000
committerGitHub <noreply@github.com>2024-04-15 18:34:51 +0200
commit66b98b62ec0ef0aa56d47af48131d661d43de579 (patch)
treefaaf994f850cc1303d699654a1129d9fd6449353 /src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt
parent377fd979821296cde9d6ceb2fa4b365e4637232a (diff)
downloadskyhanni-66b98b62ec0ef0aa56d47af48131d661d43de579.tar.gz
skyhanni-66b98b62ec0ef0aa56d47af48131d661d43de579.tar.bz2
skyhanni-66b98b62ec0ef0aa56d47af48131d661d43de579.zip
Improvement: Code cleanup, bug fix and new functions (#1445)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt b/src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt
index 3c6491ac3..0b4c3adc9 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.utils
+import at.hannibal2.skyhanni.test.command.ErrorManager
import at.hannibal2.skyhanni.utils.CollectionUtils.drainTo
import java.util.concurrent.ConcurrentLinkedQueue
import kotlin.time.Duration
@@ -22,7 +23,11 @@ object DelayedRun {
tasks.removeIf { (runnable, time) ->
val inPast = time.isInPast()
if (inPast) {
- runnable()
+ try {
+ runnable()
+ } catch (e: Exception) {
+ ErrorManager.logErrorWithData(e, "DelayedRun task crashed while executing")
+ }
}
inPast
}