This commit is contained in:
Braydon 2024-04-29 01:03:01 -04:00
parent 80f7217f9a
commit 278e3a8180
2 changed files with 4 additions and 3 deletions

View File

@ -2,7 +2,7 @@ name: Sync PIA Servers
on:
schedule:
- cron: "*/30 * * * *"
- cron: "*/15 * * * *"
push:
branches: ["master"]
paths: [".gitea/workflows/sync-servers.yml", "src/**", "pom.xml"]

View File

@ -12,6 +12,7 @@ import org.xbill.DNS.Record;
import org.xbill.DNS.*;
import java.io.*;
import java.net.InetAddress;
import java.net.URL;
import java.nio.file.Files;
import java.util.*;
@ -26,7 +27,7 @@ public final class PIAServerList {
.create();
private static final String OPENVPN_FILES_ENDPOINT = "https://www.privateinternetaccess.com/openvpn/openvpn.zip";
private static final File SERVERS_FILE = new File("servers.json");
private static final int TOTAL_RUNS = 2;
private static final int TOTAL_RUNS = 3;
@SneakyThrows
public static void main(@NonNull String[] args) {
@ -41,7 +42,7 @@ public final class PIAServerList {
// Sleep for 3 mins
if (i < TOTAL_RUNS - 1) {
System.out.println("Sleeping, waiting for another run...");
Thread.sleep(TimeUnit.MINUTES.toMillis(3L));
Thread.sleep(TimeUnit.MINUTES.toMillis(4L));
}
}