mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-19 17:37:43 +00:00
re-org plugins
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user