2022-03-03 21:45:19 +00:00
|
|
|
package dev.plex.services.impl;
|
|
|
|
|
|
|
|
import dev.plex.services.AbstractService;
|
|
|
|
|
|
|
|
public class UpdateCheckerService extends AbstractService
|
|
|
|
{
|
2022-03-17 22:16:17 +00:00
|
|
|
private boolean newVersion = false;
|
|
|
|
|
2022-03-03 21:45:19 +00:00
|
|
|
public UpdateCheckerService()
|
|
|
|
{
|
|
|
|
super(true, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void run()
|
|
|
|
{
|
|
|
|
if (!newVersion)
|
|
|
|
{
|
2022-04-01 07:54:22 +00:00
|
|
|
if (plugin.getUpdateChecker().getUpdateStatusMessage("plexusorg/Plex", "master"))
|
2022-03-03 21:45:19 +00:00
|
|
|
{
|
|
|
|
newVersion = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int repeatInSeconds()
|
|
|
|
{
|
|
|
|
// Every 30 minutes
|
|
|
|
return 1800;
|
|
|
|
}
|
|
|
|
}
|