mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Fixes attempt to index a nil value causing startup.lua to fail
This commit is contained in:
parent
2341a86ba0
commit
2b3fde4bcc
1 changed files with 9 additions and 7 deletions
|
|
@ -44,6 +44,7 @@ end
|
|||
-- @brief Performs Initialization operations performed during startup
|
||||
function recipients.initialize()
|
||||
local checks = require "checks"
|
||||
|
||||
-- Initialize builtin recipients, that is, recipients always existing an not editable from the UI
|
||||
-- For each builtin configuration type, a configuration and a recipient is created
|
||||
local all_categories = {}
|
||||
|
|
@ -51,13 +52,6 @@ function recipients.initialize()
|
|||
all_categories[#all_categories + 1] = category.id
|
||||
end
|
||||
|
||||
-- Delete (if existing) the old, string-keyed recipient and endpoint
|
||||
local sqlite_recipient = recipients.get_recipient_by_name("builtin_recipient_sqlite")
|
||||
if sqlite_recipient then
|
||||
recipients.delete_recipient(sqlite_recipient.recipient_id)
|
||||
end
|
||||
endpoints.delete_config("builtin_config_sqlite")
|
||||
|
||||
for endpoint_key, endpoint in pairs(endpoints.get_types()) do
|
||||
if endpoint.builtin then
|
||||
-- Delete (if existing) the old, string-keyed endpoint configuration
|
||||
|
|
@ -87,6 +81,14 @@ function recipients.initialize()
|
|||
end
|
||||
end
|
||||
|
||||
-- Delete (if existing) the old, string-keyed recipient and endpoint
|
||||
local sqlite_recipient = recipients.get_recipient_by_name("builtin_recipient_sqlite")
|
||||
if sqlite_recipient then
|
||||
recipients.delete_recipient(sqlite_recipient.recipient_id)
|
||||
end
|
||||
|
||||
endpoints.delete_config("builtin_config_sqlite")
|
||||
|
||||
-- Register all existing recipients in C to make sure ntopng can start with all the
|
||||
-- existing recipients properly loaded and ready for notification enqueues/dequeues
|
||||
for _, recipient in pairs(recipients.get_all_recipients()) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue