fix active

This commit is contained in:
_Bastler 2021-11-28 17:52:04 +01:00
parent 517b604768
commit 83b21eee5c

View File

@ -177,6 +177,8 @@ public class JukeboxManager implements SmartInitializingSingleton {
*/
public JsonElement getStatus() {
if (!checkToken()) {
config.setActive(false);
systemPropertyManager.set(ACTIVE, String.valueOf(config.isActive()));
return null;
}
@ -211,7 +213,7 @@ public class JukeboxManager implements SmartInitializingSingleton {
}
return status;
}
if (config.isActive()) {
config.setActive(false);
systemPropertyManager.set(ACTIVE, String.valueOf(config.isActive()));
@ -277,9 +279,11 @@ public class JukeboxManager implements SmartInitializingSingleton {
/**
* Check active.
*/
@Scheduled(cron = "${we.bstly.jukebox.cron:0 */5 0 * * * }")
@Scheduled(cron = "${we.bstly.jukebox.cron:0 */5 * * * * }")
public void checkActive() {
getStatus();
if (config.isActive()) {
getStatus();
}
}
}