kopia lustrzana https://github.com/simonw/datasette
Fixed rST code formatting, refs #834
rodzic
72ae975156
commit
ae99af2536
|
@ -1011,6 +1011,8 @@ This hook fires when the Datasette application server first starts up. You can i
|
||||||
|
|
||||||
Or you can return an async function which will be awaited on startup. Use this option if you need to make any database queries:
|
Or you can return an async function which will be awaited on startup. Use this option if you need to make any database queries:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
@hookimpl
|
@hookimpl
|
||||||
def startup(datasette):
|
def startup(datasette):
|
||||||
async def inner():
|
async def inner():
|
||||||
|
@ -1021,7 +1023,6 @@ Or you can return an async function which will be awaited on startup. Use this o
|
||||||
""", block=True)
|
""", block=True)
|
||||||
return inner
|
return inner
|
||||||
|
|
||||||
|
|
||||||
Potential use-cases:
|
Potential use-cases:
|
||||||
|
|
||||||
* Run some initialization code for the plugin
|
* Run some initialization code for the plugin
|
||||||
|
|
Ładowanie…
Reference in New Issue