static void setupLuaRecords(LuaContext& lua)
{
- if (g_luaRecordExecLimit > 0) {
- lua.executeCode(boost::str(boost::format("debug.sethook(report, '', %d)") % g_luaRecordExecLimit));
- }
-
lua.writeFunction("report", [](const string& event, const boost::optional<string>& line) -> void {
lua_report(event, line);
});
+ if (g_luaRecordExecLimit > 0) {
+ lua.executeCode(boost::str(boost::format("debug.sethook(report, '', %d)") % g_luaRecordExecLimit));
+ }
+
lua.writeFunction("latlon", []() -> string {
return lua_latlon();
});
class TestLuaRecordsShared(TestLuaRecords):
+ # The lua-records-exec-limit parameter needs to be increased from the
+ # default value of 1000, for the testGeoIPQueryAttribute test would hit
+ # the limit.
_config_template = """
geoip-database-files=../modules/geoipbackend/regression-tests/GeoLiteCity.mmdb
edns-subnet-processing=yes
enable-lua-records=shared
lua-records-insert-whitespace=yes
lua-health-checks-interval=1
+lua-records-exec-limit=1500
"""
def testCounter(self):