Don't infinite loop on tasks with no period

This commit is contained in:
md_5 2013-07-24 17:38:46 +10:00
parent c54553d0f9
commit 8a5d8a57f7

View File

@ -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 );