make bulk export commands gracefully exit on SIGPIPE (for example, if piped to head)

This commit is contained in:
Doug Hoyte
2023-07-25 00:37:56 -04:00
parent 80915f969d
commit 0fe929ffcb
6 changed files with 15 additions and 1 deletions

View File

@ -34,6 +34,8 @@ void cmd_scan(const std::vector<std::string> &subArgs) {
uint64_t numEvents = 0;
exitOnSigPipe();
while (1) {
bool complete = query.process(txn, [&](const auto &sub, uint64_t levId, std::string_view eventPayload){
if (count) numEvents++;