0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 23:40:57 +01:00

ircd:Ⓜ️:dbs: Conditional indexer; pass db::op from opts for indexer.

This commit is contained in:
Jason Volk 2018-04-28 19:05:17 -07:00
parent ed64a21872
commit 2b7358aa60
2 changed files with 3 additions and 2 deletions

View file

@ -69,6 +69,7 @@ struct ircd::m::dbs::write_opts
db::op op {db::op::SET}; db::op op {db::op::SET};
bool present {true}; bool present {true};
bool history {true}; bool history {true};
bool indexer {true};
}; };
/// Database Schema Descriptors /// Database Schema Descriptors

View file

@ -115,11 +115,11 @@ ircd::m::dbs::write(db::txn &txn,
"Cannot write to database: no index specified for event." "Cannot write to database: no index specified for event."
}; };
db::txn::append if(opts.indexer) db::txn::append
{ {
txn, dbs::event_idx, txn, dbs::event_idx,
{ {
db::op::SET, opts.op,
at<"event_id"_>(event), at<"event_id"_>(event),
byte_view<string_view>(opts.idx) byte_view<string_view>(opts.idx)
} }