|
|
@ -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)) { |
|
|
|
|
|
|
|
if (!failed) { |
|
|
|
|
|
|
|
failed = true; |
|
|
|
LOGWARNING("Failed to talk to ckdb, queueing messages"); |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|