| 530 | } |
| 531 | |
| 532 | static struct command_result *json_autoclean_once(struct command *cmd, |
| 533 | const char *buffer, |
| 534 | const jsmntok_t *params) |
| 535 | { |
| 536 | enum subsystem *subsystem; |
| 537 | u64 *age; |
| 538 | struct clean_info *cinfo; |
| 539 | |
| 540 | if (!param(cmd, buffer, params, |
| 541 | p_req("subsystem", param_subsystem, &subsystem), |
| 542 | p_req("age", param_u64_nonzero, &age), |
| 543 | NULL)) |
| 544 | return command_param_failed(); |
| 545 | |
| 546 | cinfo = tal(cmd, struct clean_info); |
| 547 | cinfo->cmd = cmd; |
| 548 | memset(cinfo->subsystem_age, 0, sizeof(cinfo->subsystem_age)); |
| 549 | cinfo->subsystem_age[*subsystem] = *age; |
| 550 | |
| 551 | return do_clean(cinfo); |
| 552 | } |
| 553 | |
| 554 | static const char *init(struct plugin *p, |
| 555 | const char *buf UNUSED, const jsmntok_t *config UNUSED) |
nothing calls this directly
no test coverage detected