Browse Source

Only show queueing message to ckdb once and display resumed message

master
Con Kolivas 10 years ago
parent
commit
973571c70c
  1. 10
      src/stratifier.c

10
src/stratifier.c

@ -2130,17 +2130,25 @@ out:
static void ckdbq_process(ckpool_t *ckp, ckdb_msg_t *data) static void ckdbq_process(ckpool_t *ckp, ckdb_msg_t *data)
{ {
static bool failed = false;
bool logged = false; bool logged = false;
char *buf = NULL; char *buf = NULL;
while (!buf) { while (!buf) {
buf = json_ckdb_call(ckp, ckdb_ids[data->idtype], data->val, logged); buf = json_ckdb_call(ckp, ckdb_ids[data->idtype], data->val, logged);
if (unlikely(!buf)) { if (unlikely(!buf)) {
LOGWARNING("Failed to talk to ckdb, queueing messages"); if (!failed) {
failed = true;
LOGWARNING("Failed to talk to ckdb, queueing messages");
}
sleep(5); sleep(5);
} }
logged = true; logged = true;
} }
if (failed) {
failed = false;
LOGWARNING("Successfully resumed talking to ckdb");
}
LOGINFO("Got %s ckdb response: %s", ckdb_ids[data->idtype], buf); LOGINFO("Got %s ckdb response: %s", ckdb_ids[data->idtype], buf);
free(buf); free(buf);
} }

Loading…
Cancel
Save