Skip to content

Commit

Permalink
Merge pull request #394 from Telecominfraproject/OLS-380-fix-file-upload
Browse files Browse the repository at this point in the history
OSL-380: fix: modified code for file upload transactions
  • Loading branch information
i-chvets authored Dec 4, 2024
2 parents 50ee4ba + 5623296 commit 7da135c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/storage/storage_command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,6 @@ namespace OpenWifi {
uint64_t Size = FileContent.str().size();

Poco::Data::Session Sess = Pool_->get();
Sess.begin();
Poco::Data::Statement Statement(Sess);

if (Size < FileUploader()->MaxSize()) {

Expand All @@ -668,9 +666,10 @@ namespace OpenWifi {
} else {
poco_warning(Logger(), fmt::format("File {} is too large.", UUID));
}
Sess.commit();

// update CommandList here to ensure that file us uploaded
Sess.begin();
Poco::Data::Statement Statement(Sess);
std::string StatementStr;
StatementStr =
"UPDATE CommandList SET WaitingForFile=?, AttachDate=?, AttachSize=? WHERE UUID=?";
Expand Down Expand Up @@ -825,4 +824,4 @@ namespace OpenWifi {
return false;
}

} // namespace OpenWifi
} // namespace OpenWifi

0 comments on commit 7da135c

Please sign in to comment.