mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 22:12:15 +00:00
host_manager
This commit is contained in:
@@ -20,14 +20,14 @@ def write_nginx_config():
|
||||
|
||||
run_dir = DEFAULT_RUNS_DIR / area / version
|
||||
if not run_dir.is_dir():
|
||||
print(f"{run_dir} doesn't exists, skipping")
|
||||
print(f" {run_dir} doesn't exists, skipping")
|
||||
continue
|
||||
|
||||
tilejson_path = run_dir / 'tilejson-tiles-org.json'
|
||||
|
||||
metadata_path = subdir / 'metadata.json'
|
||||
if not metadata_path.is_file():
|
||||
print(f"{metadata_path} doesn't exists, skipping")
|
||||
print(f" {metadata_path} doesn't exists, skipping")
|
||||
continue
|
||||
|
||||
url_prefix = f'https://tiles.openfreemap.org/{area}/{version}'
|
||||
@@ -44,7 +44,7 @@ def write_nginx_config():
|
||||
check=True,
|
||||
)
|
||||
|
||||
# TODO raise the expires times once things are stable
|
||||
# TODO # target 10y
|
||||
version_str = f"""
|
||||
location /{area}/{version} {{ # no trailing hash
|
||||
alias {tilejson_path}; # no trailing hash
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
import requests
|
||||
@@ -16,9 +17,11 @@ def assert_linux():
|
||||
sys.exit('Needs to be run on Linux')
|
||||
|
||||
|
||||
# TODO
|
||||
def assert_single_process():
|
||||
pass
|
||||
p = subprocess.run(['pgrep', '-fl', sys.argv[0]], capture_output=True, text=True)
|
||||
lines = [l for l in p.stdout.splitlines() if 'python' in l]
|
||||
if len(lines) >= 2:
|
||||
sys.exit('Detected multiple processes, terminating')
|
||||
|
||||
|
||||
def download_if_size_differs(url: str, local_file: Path) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user