mirror of
https://github.com/enzet/map-machine.git
synced 2025-08-04 00:59:54 +02:00
feat: Adds --update-cache flag to 'server'.
This commit is contained in:
parent
825eb34191
commit
90bb5b0897
2 changed files with 7 additions and 0 deletions
|
@ -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}.")
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue