| 641 | } |
| 642 | |
| 643 | static struct command_result *wait_done(struct command *cmd, |
| 644 | const char *method, |
| 645 | const char *buf, |
| 646 | const jsmntok_t *result, |
| 647 | struct per_subsystem *ps) |
| 648 | { |
| 649 | const char *err; |
| 650 | |
| 651 | err = json_scan(tmpctx, buf, result, "{created:%}", |
| 652 | JSON_SCAN(json_to_u64, &ps->max)); |
| 653 | if (err) |
| 654 | plugin_err(plugin, "Failed parsing wait response: (%s): '%.*s'", |
| 655 | err, |
| 656 | json_tok_full_len(result), |
| 657 | json_tok_full(buf, result)); |
| 658 | |
| 659 | /* We do three of these, make sure they're all complete. */ |
| 660 | assert(ps->cinfo->cleanup_reqs_remaining != 0); |
| 661 | if (--ps->cinfo->cleanup_reqs_remaining > 0) |
| 662 | return command_still_pending(ps->cinfo->cmd); |
| 663 | |
| 664 | return do_clean(ps->cinfo); |
| 665 | } |
| 666 | |
| 667 | static struct command_result *start_clean(struct clean_info *cinfo) |
| 668 | { |
nothing calls this directly
no test coverage detected