| 552 | } |
| 553 | |
| 554 | static const char *init(struct plugin *p, |
| 555 | const char *buf UNUSED, const jsmntok_t *config UNUSED) |
| 556 | { |
| 557 | plugin = p; |
| 558 | if (deprecated_cycle_seconds != UINT64_MAX) { |
| 559 | if (deprecated_cycle_seconds == 0) { |
| 560 | plugin_log(p, LOG_DBG, "autocleaning not active"); |
| 561 | return NULL; |
| 562 | } else |
| 563 | cycle_seconds = deprecated_cycle_seconds; |
| 564 | } |
| 565 | |
| 566 | cleantimer = plugin_timer(p, time_from_sec(cycle_seconds), do_clean_timer, NULL); |
| 567 | |
| 568 | for (enum subsystem i = 0; i < NUM_SUBSYSTEM; i++) { |
| 569 | rpc_scan_datastore_str(plugin, datastore_path(tmpctx, i, "num"), |
| 570 | JSON_SCAN(json_to_u64, &total_cleaned[i])); |
| 571 | } |
| 572 | |
| 573 | /* Optimization FTW! */ |
| 574 | rpc_enable_batching(p); |
| 575 | return NULL; |
| 576 | } |
| 577 | |
| 578 | static const struct plugin_command commands[] = { { |
| 579 | "autocleaninvoice", |
nothing calls this directly
no test coverage detected