mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-22 18:38:07 +00:00
use custom packing for indexable data: PackedEvent
This commit is contained in:
@ -193,7 +193,7 @@ struct Router {
|
||||
|
||||
void outgoingEvent(lmdb::txn &txn, defaultDb::environment::View_Event &ev, std::string &responseStr, tao::json::value &evJson) {
|
||||
if (dir == "down") return;
|
||||
if (!filterCompiled.doesMatch(ev.flat_nested())) return;
|
||||
if (!filterCompiled.doesMatch(PackedEventView(ev.packed()))) return;
|
||||
|
||||
if (responseStr.size() == 0) {
|
||||
auto evStr = getEventJson(txn, router->decomp, ev.primaryKeyId);
|
||||
|
@ -101,7 +101,7 @@ void cmd_stream(const std::vector<std::string> &subArgs) {
|
||||
env.foreach_Event(txn, [&](auto &ev){
|
||||
currEventId = ev.primaryKeyId;
|
||||
|
||||
auto id = std::string(sv(ev.flat_nested()->id()));
|
||||
auto id = std::string(PackedEventView(ev.packed()).id());
|
||||
if (downloadedIds.find(id) != downloadedIds.end()) {
|
||||
downloadedIds.erase(id);
|
||||
return true;
|
||||
|
@ -72,7 +72,8 @@ void cmd_sync(const std::vector<std::string> &subArgs) {
|
||||
|
||||
for (auto levId : levIds) {
|
||||
auto ev = lookupEventByLevId(txn, levId);
|
||||
ne.addItem(ev.flat_nested()->created_at(), sv(ev.flat_nested()->id()).substr(0, ne.idSize));
|
||||
PackedEventView packed(ev.packed());
|
||||
ne.addItem(packed.created_at(), packed.id().substr(0, ne.idSize));
|
||||
}
|
||||
|
||||
LI << "Filter matches " << numEvents << " events";
|
||||
|
Reference in New Issue
Block a user