martinzink commented on code in PR #1352:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1352#discussion_r902239657
##########
extensions/sftp/processors/ListSFTP.cpp:
##########
@@ -323,8 +323,8 @@ bool ListSFTP::createAndTransferFlowFileFromChild(
logger_->log_error("Modification date %lu of \"%s/%s\" larger than int64_t
max", child.attrs.mtime, child.parent_path.c_str(), child.filename.c_str());
return true;
}
- std::string mtime_str;
- if
(!utils::timeutils::getDateTimeStr(gsl::narrow<int64_t>(child.attrs.mtime),
mtime_str)) {
+ auto mtime_str =
utils::timeutils::getDateTimeStr(date::sys_seconds{std::chrono::seconds(child.attrs.mtime)});
+ if (!mtime_str) {
logger_->log_error("Failed to convert modification date %lu of \"%s/%s\"
to string", child.attrs.mtime, child.parent_path.c_str(),
child.filename.c_str());
return true;
Review Comment:
No idea to be honest, but you are right on first sight that seems
unintentional.
But I think fixing that is out of the scope of this PR, since the caller
yields and ends the onTrigger if this return false. It would probably need a
bit more investigation/refactor to fix this. (This was introduced in 2019)
--
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]