| 1279 | u64 next_index); |
| 1280 | |
| 1281 | static struct command_result *wait_done(struct command *auxcmd, |
| 1282 | const char *method, |
| 1283 | const char *buf, |
| 1284 | const jsmntok_t *result, |
| 1285 | struct table_desc *td) |
| 1286 | { |
| 1287 | const jsmntok_t *valtok; |
| 1288 | const char *indexname; |
| 1289 | u64 val; |
| 1290 | |
| 1291 | if ((valtok = json_get_member(buf, result, "created")) != NULL) { |
| 1292 | indexname = "created"; |
| 1293 | td->refresh_needs |= REFRESH_CREATED; |
| 1294 | } else if ((valtok = json_get_member(buf, result, "updated")) != NULL) { |
| 1295 | indexname = "updated"; |
| 1296 | td->refresh_needs |= REFRESH_UPDATED; |
| 1297 | } else if ((valtok = json_get_member(buf, result, "deleted")) != NULL) { |
| 1298 | indexname = "deleted"; |
| 1299 | td->refresh_needs |= REFRESH_DELETED; |
| 1300 | } else { |
| 1301 | plugin_err(auxcmd->plugin, |
| 1302 | "Invalid wait_done for %s: '%.*s'", |
| 1303 | td->name, |
| 1304 | json_tok_full_len(result), |
| 1305 | json_tok_full(buf, result)); |
| 1306 | } |
| 1307 | |
| 1308 | if (!json_to_u64(buf, valtok, &val)) { |
| 1309 | plugin_err(auxcmd->plugin, |
| 1310 | "Invalid wait_done index for %s: '%.*s'", |
| 1311 | td->name, |
| 1312 | json_tok_full_len(result), |
| 1313 | json_tok_full(buf, result)); |
| 1314 | } |
| 1315 | |
| 1316 | /* Keep watching for next one */ |
| 1317 | watch_for(sql_of(auxcmd->plugin), td, indexname, val + 1); |
| 1318 | return command_still_pending(auxcmd); |
| 1319 | } |
| 1320 | |
| 1321 | static void watch_for(struct sql *sql, |
| 1322 | struct table_desc *td, |
nothing calls this directly
no test coverage detected