| 113 | } |
| 114 | |
| 115 | void FlowFileRepository::run() { |
| 116 | auto last = std::chrono::steady_clock::now(); |
| 117 | if (running_) { |
| 118 | prune_stored_flowfiles(); |
| 119 | } |
| 120 | while (running_) { |
| 121 | std::this_thread::sleep_for(std::chrono::milliseconds(purge_period_)); |
| 122 | flush(); |
| 123 | auto now = std::chrono::steady_clock::now(); |
| 124 | if ((now-last) > std::chrono::seconds(30)) { |
| 125 | printStats(); |
| 126 | last = now; |
| 127 | } |
| 128 | } |
| 129 | flush(); |
| 130 | } |
| 131 | |
| 132 | void FlowFileRepository::prune_stored_flowfiles() { |
| 133 | rocksdb::Options options; |