|
|
|
@@ -95,25 +95,15 @@ public abstract class CommEngine extends HttpServlet |
|
|
|
{ |
|
|
|
while (!threadShouldStop) |
|
|
|
{ |
|
|
|
String timeOfDay = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm")); |
|
|
|
// Check for pause |
|
|
|
for (Broadcast broadcast : broadcasts.values()) |
|
|
|
{; |
|
|
|
// Check for pause |
|
|
|
if (broadcast.daily_stop.length() > 0) |
|
|
|
{ |
|
|
|
if (timeOfDay.equals(broadcast.daily_stop)) broadcast.pause("clock", null); |
|
|
|
} |
|
|
|
|
|
|
|
// Check for resume |
|
|
|
if (broadcast.daily_start.length() > 0) |
|
|
|
{ |
|
|
|
if (timeOfDay.equals(broadcast.daily_start)) broadcast.resume(Broadcast.ACTION_BY_CLOCK); |
|
|
|
} |
|
|
|
{ |
|
|
|
broadcast.enforceOperationHours(); |
|
|
|
} |
|
|
|
|
|
|
|
// sleep till next wall clock minute |
|
|
|
long currentTime = System.currentTimeMillis(); |
|
|
|
long sleepTime = 60000 + 30000 - currentTime % 60000; |
|
|
|
long sleepTime = 60000 - currentTime % 60000; |
|
|
|
if (sleepTime > 0) |
|
|
|
{ |
|
|
|
try |
|
|
|
|