feat: Adds --update-cache flag to 'server'.

This commit is contained in:
Clement Skau 2023-10-06 20:58:55 +02:00
parent 825eb34191
commit 90bb5b0897
2 changed files with 7 additions and 0 deletions

View file

@ -74,6 +74,7 @@ def run_server(options: argparse.Namespace) -> None:
try:
handler = TileServerHandler
handler.cache = Path(options.cache)
handler.update_cache = options.update_cache
handler.options = options
server = HTTPServer(("", options.port), handler)
logging.info(f"Server started on port {options.port}.")

View file

@ -270,6 +270,12 @@ def add_server_arguments(parser: argparse.ArgumentParser) -> None:
default="cache",
metavar="<path>",
)
parser.add_argument(
"--update-cache",
action=argparse.BooleanOptionalAction,
default=True,
help="allow writing to cache",
)
parser.add_argument(
"--port",
help="port number",