Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSL-380: fix: modified code for file upload transactions #394

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading