MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / ExecuteWithRetry

Method ExecuteWithRetry

extensions/rocksdb-repos/FlowFileRepository.cpp:187–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187bool 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.

Callers

nothing calls this directly

Calls 2

log_traceMethod · 0.80
log_errorMethod · 0.80

Tested by

no test coverage detected