Fine tune updater

This commit is contained in:
crschnick 2024-11-19 11:23:41 +00:00
parent 3be6f70272
commit 65a4cc424b
4 changed files with 6 additions and 1 deletions

View file

@ -2,6 +2,7 @@ package io.xpipe.app.ext;
import io.xpipe.app.issue.ErrorEvent; import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.core.process.ShellControl; import io.xpipe.core.process.ShellControl;
import io.xpipe.core.process.StubShellControl;
import io.xpipe.core.store.*; import io.xpipe.core.store.*;
public interface ShellStore extends DataStore, FileSystemStore, ValidatableStore, SingletonSessionStore<ShellSession> { public interface ShellStore extends DataStore, FileSystemStore, ValidatableStore, SingletonSessionStore<ShellSession> {

View file

@ -4,6 +4,7 @@ import io.xpipe.app.core.AppProperties;
import io.xpipe.app.issue.ErrorEvent; import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.app.issue.TrackEvent; import io.xpipe.app.issue.TrackEvent;
import io.xpipe.app.util.HttpHelper; import io.xpipe.app.util.HttpHelper;
import io.xpipe.app.util.LicenseProvider;
import io.xpipe.core.process.OsType; import io.xpipe.core.process.OsType;
import io.xpipe.core.util.JacksonMapper; import io.xpipe.core.util.JacksonMapper;
@ -127,6 +128,7 @@ public class AppDownloads {
req.put("uuid", AppProperties.get().getUuid().toString()); req.put("uuid", AppProperties.get().getUuid().toString());
req.put("version", AppProperties.get().getVersion()); req.put("version", AppProperties.get().getVersion());
req.put("first", first); req.put("first", first);
req.put("license", LicenseProvider.get().getLicenseId());
var url = URI.create("https://api.xpipe.io/version"); var url = URI.create("https://api.xpipe.io/version");
var builder = HttpRequest.newBuilder(); var builder = HttpRequest.newBuilder();

View file

@ -100,7 +100,7 @@ public abstract class UpdateHandler {
private void startBackgroundUpdater() { private void startBackgroundUpdater() {
ThreadHelper.createPlatformThread("updater", true, () -> { ThreadHelper.createPlatformThread("updater", true, () -> {
var checked = false; var checked = false;
ThreadHelper.sleep(Duration.ofMinutes(5).toMillis()); ThreadHelper.sleep(Duration.ofMinutes(1).toMillis());
event("Starting background updater thread"); event("Starting background updater thread");
while (true) { while (true) {
if (AppPrefs.get().automaticallyUpdate().get() if (AppPrefs.get().automaticallyUpdate().get()

View file

@ -20,6 +20,8 @@ public abstract class LicenseProvider {
public abstract boolean hasLicense(); public abstract boolean hasLicense();
public abstract String getLicenseId();
public abstract ObservableValue<String> licenseTitle(); public abstract ObservableValue<String> licenseTitle();
public abstract LicensedFeature getFeature(String id); public abstract LicensedFeature getFeature(String id);