Skip to content

Commit

Permalink
Fix serve mode errors
Browse files Browse the repository at this point in the history
(cherry picked from commit 466ce1a513abb9463eae301c6a390fa4e0c03d02)
  • Loading branch information
pnorman committed Feb 2, 2024
1 parent 1ee77b9 commit 7113373
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tilekiln/scripts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ def live(config, bind_host, bind_port, num_threads,


@cli.command()
@click.option('--config', type=click.Path(exists=True))
@click.option('--bind-host', default='127.0.0.1', show_default=True,
help='Bind socket to this host. ')
@click.option('--bind-port', default=8000, show_default=True,
Expand All @@ -171,17 +170,11 @@ def live(config, bind_host, bind_port, num_threads,
@click.option('--storage-username')
@click.option('--base-url', help='Defaults to http://127.0.0.1:8000' +
' or the bind host and port')
@click.option('--id', help='Override YAML config ID')
def serve(config, bind_host, bind_port, num_threads,
storage_dbname, storage_host, storage_port, storage_username, base_url, id):
def serve(bind_host, bind_port, num_threads,
storage_dbname, storage_host, storage_port, storage_username, base_url):
'''Starts a server for pre-generated tiles from DB'''

if config is None and id is None:
raise click.UsageError('''Missing one of '--id' or '--config' options''')

os.environ[tilekiln.server.TILEKILN_THREADS] = str(num_threads)
# If id is not specified, we know the config is from above, so get the id from it
os.environ[tilekiln.server.TILEKILN_ID] = id or tilekiln.load_config(config).id

if base_url is not None:
os.environ[tilekiln.dev.TILEKILN_URL] = base_url
Expand Down

0 comments on commit 7113373

Please sign in to comment.