This commit is contained in:
Clement Skau 2023-10-06 19:02:36 +00:00 committed by GitHub
commit 4210a549fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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",