re-org plugins

This commit is contained in:
Doug Hoyte
2023-08-17 17:41:00 -04:00
parent 93330c4cbc
commit 98f1020ef3
4 changed files with 35 additions and 38 deletions

View File

@ -10,7 +10,7 @@
#include "DBQuery.h"
#include "filters.h"
#include "events.h"
#include "PluginWritePolicy.h"
#include "PluginEventSifter.h"
static const char USAGE[] =
@ -84,7 +84,7 @@ void cmd_sync(const std::vector<std::string> &subArgs) {
WriterPipeline writer;
WSConnection ws(url);
PluginWritePolicy writePolicy;
PluginEventSifter writePolicyPlugin;
ws.reconnect = false;
@ -160,8 +160,8 @@ void cmd_sync(const std::vector<std::string> &subArgs) {
auto &evJson = msg.at(2);
std::string okMsg;
auto res = writePolicy.acceptEvent(evJson, hoytech::curr_time_s(), EventSourceType::Sync, ws.remoteAddr, okMsg);
if (res == WritePolicyResult::Accept) {
auto res = writePolicyPlugin.acceptEvent(cfg().relay__writePolicy__plugin, evJson, hoytech::curr_time_s(), EventSourceType::Sync, ws.remoteAddr, okMsg);
if (res == PluginEventSifterResult::Accept) {
writer.write({ std::move(evJson), EventSourceType::Sync, url });
} else {
LI << "[" << ws.remoteAddr << "] write policy blocked event " << evJson.at("id").get_string() << ": " << okMsg;