fix active

This commit is contained in:
2021-11-28 17:52:04 +01:00
parent 517b604768
commit 83b21eee5c
@@ -177,6 +177,8 @@ public class JukeboxManager implements SmartInitializingSingleton {
*/ */
public JsonElement getStatus() { public JsonElement getStatus() {
if (!checkToken()) { if (!checkToken()) {
config.setActive(false);
systemPropertyManager.set(ACTIVE, String.valueOf(config.isActive()));
return null; return null;
} }
@@ -277,9 +279,11 @@ public class JukeboxManager implements SmartInitializingSingleton {
/** /**
* Check active. * Check active.
*/ */
@Scheduled(cron = "${we.bstly.jukebox.cron:0 */5 0 * * * }") @Scheduled(cron = "${we.bstly.jukebox.cron:0 */5 * * * * }")
public void checkActive() { public void checkActive() {
getStatus(); if (config.isActive()) {
getStatus();
}
} }
} }