Skip to content

Commit

Permalink
use new fastcopy function for file upload endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
nam20485 committed Feb 29, 2024
1 parent 6e1989c commit f9ce8f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions OdbDesignServer/Controllers/FileUploadController.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "FileUploadController.h"
#include "fastcopy.h"

using namespace std::filesystem;
using namespace Odb::Lib::App;
using namespace Utils;

namespace Odb::App::Server
{
Expand Down Expand Up @@ -104,7 +106,8 @@ namespace Odb::App::Server

path finalPath(m_serverApp.args().designsDir());
finalPath /= safeName;
rename(tempPath, finalPath);
//rename(tempPath, finalPath);
auto ec = fastcopy(tempPath, finalPath, false);

Check warning on line 110 in OdbDesignServer/Controllers/FileUploadController.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (ubuntu-22.04, linux-release)

variable ‘ec’ set but not used [-Wunused-but-set-variable]

Check warning on line 110 in OdbDesignServer/Controllers/FileUploadController.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (macos-12, macos-release)

unused variable 'ec' [-Wunused-variable]

std::string responseBody = "{ \"filename\": \"" + safeName + "\" }";

Expand Down Expand Up @@ -170,7 +173,8 @@ namespace Odb::App::Server
auto safeName = sanitizeFilename(outfile_name);
path finalPath(m_serverApp.args().designsDir());
finalPath /= safeName;
rename(tempPath, finalPath);
//rename(tempPath, finalPath);
auto ec = fastcopy(tempPath, finalPath, false);

Check warning on line 177 in OdbDesignServer/Controllers/FileUploadController.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (ubuntu-22.04, linux-release)

variable ‘ec’ set but not used [-Wunused-but-set-variable]

Check warning on line 177 in OdbDesignServer/Controllers/FileUploadController.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (macos-12, macos-release)

unused variable 'ec' [-Wunused-variable]

CROW_LOG_INFO << " Contents written to " << outfile_name << '\n';
}
Expand Down

0 comments on commit f9ce8f6

Please sign in to comment.