Skip to content

Commit

Permalink
updated #27
Browse files Browse the repository at this point in the history
  • Loading branch information
kudzinp committed Jul 10, 2019
1 parent a55779b commit e2310ba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions notifier.cpp
Expand Up @@ -83,15 +83,18 @@ int main(int argc, char** argv) {
natsOptions_Destroy(opts);
stanConnOptions_Destroy(connOpts);

bool is_warn = false;
while (s == NATS_OK) {
auto msg = std::make_unique<message>();
static const auto start = "{\"msg_type\":\""; // ok, it's ugly. TODO: ?parse json
static const auto start_len = strlen(start);
std::getline(std::cin, msg->data);
if (done) {
if (msg->data.size()) {
std::cerr << "WARNING! Pipe hasn't empty." << std::endl;
done = false;
if (!is_warn) {
std::cerr << "WARNING! Pipe hasn't empty." << std::endl;
is_warn = true;
}
} else
break;
}
Expand Down

0 comments on commit e2310ba

Please sign in to comment.