Add check to redbean to limit ProgramMaxWorkers call to the main process.

This commit is contained in:
Paul Kulchenko 2022-08-02 17:11:18 -07:00
parent c478e101f5
commit 90c9584e67

View file

@ -4749,6 +4749,7 @@ static int LuaProgramHeartbeatInterval(lua_State *L) {
} }
static int LuaProgramMaxWorkers(lua_State *L) { static int LuaProgramMaxWorkers(lua_State *L) {
OnlyCallFromMainProcess(L, "ProgramMaxWorkers");
if (!lua_isinteger(L, 1) && !lua_isnoneornil(L, 1)) { if (!lua_isinteger(L, 1) && !lua_isnoneornil(L, 1)) {
return luaL_argerror(L, 1, "invalid number of workers; integer expected"); return luaL_argerror(L, 1, "invalid number of workers; integer expected");
} }