| 665 | } |
| 666 | |
| 667 | static struct command_result *start_clean(struct clean_info *cinfo) |
| 668 | { |
| 669 | cinfo->cleanup_reqs_remaining = 0; |
| 670 | |
| 671 | /* We have to get max indexes first. */ |
| 672 | for (size_t i = 0; i < NUM_SUBSYSTEM_TYPES; i++) { |
| 673 | struct per_subsystem *ps = &cinfo->per_subsystem[i]; |
| 674 | const struct subsystem_ops *ops = get_subsystem_ops(ps); |
| 675 | struct out_req *req; |
| 676 | |
| 677 | /* Reset counters while we're here */ |
| 678 | ps->num_uncleaned = 0; |
| 679 | for (enum subsystem_variant j = 0; j < NUM_SUBSYSTEM_VARIANTS; j++) { |
| 680 | struct per_variant *pv = &ps->variants[j]; |
| 681 | pv->num_cleaned = 0; |
| 682 | } |
| 683 | ps->offset = 0; |
| 684 | |
| 685 | req = jsonrpc_request_start(cinfo->cmd, |
| 686 | "wait", |
| 687 | wait_done, plugin_broken_cb, ps); |
| 688 | json_add_string(req->js, "subsystem", ops->system_name); |
| 689 | json_add_string(req->js, "indexname", "created"); |
| 690 | json_add_u64(req->js, "nextvalue", 0); |
| 691 | send_outreq(req); |
| 692 | cinfo->cleanup_reqs_remaining++; |
| 693 | } |
| 694 | |
| 695 | return command_still_pending(cinfo->cmd); |
| 696 | } |
| 697 | |
| 698 | /* Needs a different signature than do_clean */ |
| 699 | static struct command_result *do_clean_timer(struct command *cmd, void *unused) |
no test coverage detected