mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Force initial .inspect() before starting server
Otherwise there is a long pause on the first request made.
This commit is contained in:
parent
4143e3b45c
commit
495407acef
1 changed files with 5 additions and 3 deletions
|
|
@ -104,10 +104,12 @@ def serve(files, host, port, debug, reload, inspect_file, metadata):
|
|||
metadata_data = json.loads(metadata.read())
|
||||
|
||||
click.echo('Serve! files={} on port {}'.format(files, port))
|
||||
app = Datasette(
|
||||
ds = Datasette(
|
||||
files,
|
||||
cache_headers=not debug and not reload,
|
||||
inspect_data=inspect_data,
|
||||
metadata=metadata_data,
|
||||
).app()
|
||||
app.run(host=host, port=port, debug=debug)
|
||||
)
|
||||
# Force initial hashing/table counting
|
||||
ds.inspect()
|
||||
ds.app().run(host=host, port=port, debug=debug)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue