martinzink commented on a change in pull request #1225:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1225#discussion_r769572959
##########
File path: extensions/sftp/processors/ListSFTP.cpp
##########
@@ -965,25 +966,18 @@ void ListSFTP::onTrigger(const
std::shared_ptr<core::ProcessContext> &context, c
/* Parse processor-specific properties */
std::string remote_path;
- uint64_t entity_tracking_time_window = 0U;
+ std::chrono::milliseconds entity_tracking_time_window = 3h; /* The default
is 3 hours */
std::string value;
context->getProperty(RemotePath.getName(), remote_path);
/* Remove trailing slashes */
while (remote_path.size() > 1U && remote_path.back() == '/') {
remote_path.resize(remote_path.size() - 1);
}
- if (context->getProperty(EntityTrackingTimeWindow.getName(), value)) {
- core::TimeUnit unit;
- if (!core::Property::StringToTime(value, entity_tracking_time_window,
unit) ||
- !core::Property::ConvertTimeUnitToMS(entity_tracking_time_window,
unit, entity_tracking_time_window)) {
- /* The default is 3 hours */
- entity_tracking_time_window = 3 * 3600 * 1000;
- logger_->log_error("Entity Tracking Time Window attribute is invalid");
- }
+ if (auto entity_tracking_window =
context->getProperty<core::TimePeriodValue>(EntityTrackingTimeWindow)) {
+ entity_tracking_time_window = entity_tracking_window->getMilliseconds();
} else {
- /* The default is 3 hours */
- entity_tracking_time_window = 3 * 3600 * 1000;
+ logger_->log_error("Entity Tracking Time Window attribute is invalid");
Review comment:
good catch, changed back to original behaviour so missing property
doesnt cause error logs in
https://github.com/apache/nifi-minifi-cpp/pull/1225/commits/78f8658fde802c73a5965dd734a544acbc37dca3
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]