mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
fix startWork
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user