mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Added asgi_wrapper plugin hook, closes #520
This commit is contained in:
parent
b9ede4c189
commit
4d2fdafe39
5 changed files with 78 additions and 1 deletions
|
|
@ -651,9 +651,12 @@ class Datasette:
|
|||
if not database.is_mutable:
|
||||
await database.table_counts(limit=60 * 60 * 1000)
|
||||
|
||||
return AsgiLifespan(
|
||||
asgi = AsgiLifespan(
|
||||
AsgiTracer(DatasetteRouter(self, routes)), on_startup=setup_db
|
||||
)
|
||||
for wrapper in pm.hook.asgi_wrapper(datasette=self):
|
||||
asgi = wrapper(asgi)
|
||||
return asgi
|
||||
|
||||
|
||||
class DatasetteRouter(AsgiRouter):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue