mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-20 09:30:31 +00:00
Add OnServerReload to replace /.reload.lua with a bit more flexibility (#851)
This commit is contained in:
parent
3a9cac4892
commit
d0d027810a
2 changed files with 19 additions and 7 deletions
|
@ -499,7 +499,7 @@ SPECIAL PATHS
|
|||
this path is a hidden file so that it can't be unintentionally run
|
||||
by the network client.
|
||||
|
||||
/.reload.lua
|
||||
/.reload.lua (deprecated; use OnServerReload instead)
|
||||
This script is run from the main process when SIGHUP is received.
|
||||
This only applies to redbean when running in daemon mode. Any
|
||||
changes that are made to the Lua interpreter state will be
|
||||
|
@ -612,6 +612,12 @@ HOOKS
|
|||
to modify socket configuration to set `SO_REUSEPORT`, for example.
|
||||
If it returns `true`, redbean will not listen to that ip/port.
|
||||
|
||||
OnServerReload(reindex:bool)
|
||||
If this function is defined it'll be called from the main process
|
||||
on each server reload triggered by SIGHUP (for deamonized) and
|
||||
SIGUSR1 (for all) redbean instances. reindex indicates if redbean
|
||||
assets have been re-indexed following the signal.
|
||||
|
||||
OnServerStart()
|
||||
If this function is defined it'll be called from the main process
|
||||
right before the main event loop starts.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue