| 185 | } |
| 186 | |
| 187 | bool FlowFileRepository::ExecuteWithRetry(std::function<rocksdb::Status()> operation) { |
| 188 | int waitTime = 0; |
| 189 | for (int i=0; i<3; ++i) { |
| 190 | auto status = operation(); |
| 191 | if (status.ok()) { |
| 192 | logger_->log_trace("Rocksdb operation executed successfully"); |
| 193 | return true; |
| 194 | } |
| 195 | logger_->log_error("Rocksdb operation failed: %s", status.ToString()); |
| 196 | waitTime += FLOWFILE_REPOSITORY_RETRY_INTERVAL_INCREMENTS; |
| 197 | std::this_thread::sleep_for(std::chrono::milliseconds(waitTime)); |
| 198 | } |
| 199 | return false; |
| 200 | } |
| 201 | |
| 202 | /** |
| 203 | * Returns True if there is data to interrogate. |