Add ru1 + bump data version (#4)

This commit is contained in:
Roman Tsisyk 2022-02-05 11:06:42 +03:00 committed by GitHub
parent 44b314e669
commit ea22715a7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@ const SERVER = {
fi1: 'https://cdn-fi1.organicmaps.app/', // Hetzner Cloud (Helsinki, Finland), 20TB/mo
de1: 'https://cdn-eu2.organicmaps.app/', // Hetzner Cloud (Falkenstein, Germany), 20TB/mo
us2: 'https://cdn-us2.organicmaps.app/', // Hetzner Cloud (Asburn, US East), 20TB/mo
ru1: 'https://cdn-ru1.organicmaps.app/', // Sergei Krashevich (SVK Telecom) (Moscow, Russia), unmetered
};
// Main entry point.
@ -32,8 +32,8 @@ function extractDataVersion(request: Request): Number {
// TODO: Implement automated version checks from this metaserver script.
// It should check by cron if actual files are really available on all servers.
const LAST_AVAILABLE_VERSION = 211002;
const BEFORE_LAST_AVAILABLE_VERSION = 211022;
const LAST_AVAILABLE_VERSION = 211022;
const BEFORE_LAST_AVAILABLE_VERSION = 211122;
async function handleRequest(request: Request) {
const { pathname } = new URL(request.url);
@ -55,10 +55,10 @@ async function handleRequest(request: Request) {
case 'NA': // North America
case 'SA': // South America
case 'OC': // Oceania
servers = [SERVER.backblaze, SERVER.us2, SERVER.uk1, SERVER.nl1, SERVER.planet];
servers = [SERVER.backblaze, SERVER.us2, SERVER.uk1, SERVER.nl1, SERVER.ru1, SERVER.planet];
break;
default: // Every other continent + Tor networks.
servers = [SERVER.planet, SERVER.uk1, SERVER.nl1, SERVER.fi1, SERVER.de1];
servers = [SERVER.planet, SERVER.uk1, SERVER.nl1, SERVER.fi1, SERVER.ru1, SERVER.de1];
}
return new Response(JSON.stringify(servers), {
headers: { 'Content-Type': 'application/json' },