require Guardian::Base;
require Guardian::Config;
require Guardian::Daemon;
+require Guardian::Events;
require Guardian::Logger;
require Guardian::Parser;
require Guardian::Socket;
# Redirect perls "die" messages to the logger before exiting.
$SIG{__DIE__} = sub { $logger->Log("err", "@_"); };
+# Initialize the event handler.
+my $events = Guardian::Events->Init(%mainsettings);
+
# Shared hash between the main process and all threads. It will store all
# monitored files and their current file position.
my %monitored_files :shared = ();
# Log processed event.
$logger->Log("debug", "QUEUE - Processed event: $event");
+ # Send event data to the events parser to determine
+ # if any action is required.
+ $events->CheckAction($event);
+
# Drop processed event from queue.
$queue->dequeue();
}
+ # Call RemoveBlocks routine from the Events module to check
+ # if items from the block list can be dropped.
+ $events->RemoveBlocks();
+
# Sleep 10ms to reduce the load of the main process.
sleep(0.01);
}