mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Fixed: #13208
This commit is contained in:
parent
82993fa6f1
commit
050eb98f0b
2 changed files with 9 additions and 1 deletions
|
@ -291,7 +291,7 @@ module LogStash module Filters module Geoip class DatabaseManager
|
|||
end
|
||||
|
||||
def unsubscribe_database_path(database_type, geoip_plugin)
|
||||
@states[database_type].plugins.delete(geoip_plugin) if geoip_plugin
|
||||
@states[database_type].plugins.delete(geoip_plugin) if geoip_plugin && @states
|
||||
end
|
||||
|
||||
def database_path(database_type)
|
||||
|
|
|
@ -378,5 +378,13 @@ describe LogStash::Filters::Geoip do
|
|||
end
|
||||
end
|
||||
|
||||
context "shutdown" do
|
||||
let(:db_manager) { manager = Class.new(LogStash::Filters::Geoip::DatabaseManager).instance }
|
||||
|
||||
it "should unsubscribe gracefully" do
|
||||
db_manager.subscribe_database_path(CITY, default_city_db_path, mock_geoip_plugin)
|
||||
expect { db_manager.unsubscribe_database_path(CITY, mock_geoip_plugin) }.not_to raise_error
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue