mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-24 17:47:41 +01:00
Don't infinite loop on tasks with no period
This commit is contained in:
parent
c54553d0f9
commit
8a5d8a57f7
@ -61,6 +61,12 @@ public class BungeeTask implements Runnable, ScheduledTask
|
||||
ProxyServer.getInstance().getLogger().log( Level.SEVERE, String.format( "Task %s encountered an exception", this ), t );
|
||||
}
|
||||
|
||||
// If we have a period of 0 or less, only run once
|
||||
if ( period <= 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep( period );
|
||||
|
Loading…
Reference in New Issue
Block a user