addEventHandler("onShutdown", root, function(element resource, string reason) … end)
Handler parameters
| Name | Type | Description |
|---|---|---|
| resource | element | The root element of the resource that called shutdown. |
| reason | string | The reason given to shutdown. |
Source
The root element (root).
Example
addEventHandler("onShutdown", root, function(resource, reason)
dbExec(db, "INSERT INTO server_log (event, detail) VALUES (?, ?)", "shutdown", reason)
end)