sections: internals:datasette-close
This data as json
| id | page | ref | title | content | breadcrumbs | references |
|---|---|---|---|---|---|---|
| internals:datasette-close | internals | datasette-close | .close() | Release all resources held by this Datasette instance. This calls db.close() on every attached database (including the internal database), shuts down the thread pool executor used to run SQL queries, and unlinks the temporary file used to back the internal database if one was created. close() is synchronous, idempotent and one-way: after a call to close() any attempt to use the Datasette instance to execute SQL will raise a datasette.database.DatasetteClosedError exception. A closed Datasette cannot be reopened — callers that need a fresh instance should construct a new one. If a call to Database.close() on one of the attached databases raises an exception, Datasette.close() will continue trying to close the remaining databases and will re-raise the first exception after every database has been processed. When Datasette is being served over ASGI the close() method is wired up to the lifespan shutdown event, so resources are released cleanly on SIGTERM / SIGINT . | ["Internals for plugins", "Datasette class"] | [] |