fix startWork

This commit is contained in:
adbenitez
2025-12-09 15:05:42 +01:00
parent 10b966a7c8
commit e315d0505c
@@ -29,12 +29,6 @@ public class WebxdcGarbageCollectionWorker extends ListenableWorker {
public @NonNull ListenableFuture<Result> startWork() {
Log.i(TAG, "Running Webxdc storage garbage collection...");
Rpc rpc = DcHelper.getRpc(context);
if (rpc == null) {
Log.e(TAG, "Failed to get access to RPC, Webxdc storage garbage collection aborted.");
return;
}
final Pattern WEBXDC_URL_PATTERN =
Pattern.compile("^https?://acc(\\d+)-msg(\\d+)\\.localhost/?");
@@ -48,6 +42,13 @@ public class WebxdcGarbageCollectionWorker extends ListenableWorker {
return;
}
Rpc rpc = DcHelper.getRpc(context);
if (rpc == null) {
Log.e(TAG, "Failed to get access to RPC, Webxdc storage garbage collection aborted.");
completer.set(Result.failure());
return;
}
for (Object key : origins.keySet()) {
String url = (String)key;
Matcher m = WEBXDC_URL_PATTERN.matcher(url);