Skip to content

Commit 2a0dd3e

Browse files
committed
higher 30s timeout for awaiting compilation success
1 parent c568c2b commit 2a0dd3e

File tree

1 file changed

+3
-3
lines changed
  • cranberri-server-plugin/src/main/kotlin/jupiterpi/cranberri

1 file changed

+3
-3
lines changed

cranberri-server-plugin/src/main/kotlin/jupiterpi/cranberri/computers.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import org.bukkit.event.block.Action
1414
import org.bukkit.event.block.BlockBreakEvent
1515
import org.bukkit.event.player.PlayerInteractEvent
1616
import org.bukkit.util.Vector
17+
import java.util.Date
1718

1819
val COMPUTER_MATERIAL = Material.TARGET
1920

@@ -67,10 +68,9 @@ class Computer(
6768
}
6869
}
6970

70-
var invocations = 0
71+
val timeoutStart = Date().time
7172
Bukkit.getScheduler().runTaskTimer(plugin, { task ->
72-
invocations++
73-
if (invocations > 40) task.cancel()
73+
if (Date().time - timeoutStart > 30*1000) task.cancel()
7474

7575
if (runningScript != null) {
7676
task.cancel()

0 commit comments

Comments
 (0)