Skip to content

Commit

Permalink
Log submitted and requested jobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewerf committed Oct 12, 2024
1 parent e1d1a1e commit 1229728
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Controller::ExpectedOrError<JobId> Controller::submit_( drogon::HttpRequestPtr r

const auto jobId = drogon::utils::getUuid();
file.saveAs( getInputFileName( jobId ) );
LOG_DEBUG << "Submitted job: " << jobId;

app().getLoop()->queueInLoop( [jobId, this]
{
Expand Down Expand Up @@ -100,6 +101,7 @@ Controller::ExpectedOrError<Job> Controller::getInfo_( drogon::HttpRequestPtr re
= req->getOptionalParameter<std::string>( "job_id" )
.and_then( [this] ( auto jobId ) -> std::optional<Job>
{
LOG_DEBUG << "Requested job info: " << jobId;
std::shared_lock lock( jobsMutex_ );
auto it = jobs_.find( jobId );
if ( it != jobs_.end() )
Expand All @@ -117,6 +119,7 @@ Controller::ExpectedOrError<Job> Controller::getInfo_( drogon::HttpRequestPtr re
drogon::HttpResponsePtr Controller::getResult_( drogon::HttpRequestPtr req )
{
const auto maybeTask = req->getOptionalParameter<std::string>( "job_id" );
LOG_DEBUG << "Requested job result: " << maybeTask.value_or( "[empty job_id]" );
const auto maybeOutput = maybeTask.transform( getOutputPath );
if ( !maybeOutput || !std::filesystem::exists( *maybeOutput ) )
{
Expand Down

0 comments on commit 1229728

Please sign in to comment.