Skip to content

Commit

Permalink
bit of comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderManich committed Nov 29, 2023
1 parent b7a6a3d commit 1943323
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/ecdar_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ impl ConcreteEcdarApi {

#[tonic::async_trait]
impl EcdarApi for ConcreteEcdarApi {
/// Gets a Model and its queries from the database.
///
/// If the Model is not in use, it will now be in use by the requestees session,
/// given that they are an Editor.
async fn get_model(
&self,
request: Request<GetModelRequest>,
Expand Down Expand Up @@ -145,6 +149,7 @@ impl EcdarApi for ConcreteEcdarApi {
let mut in_use_bool = true;
match self.contexts.in_use_context.get_by_id(model_id).await {
Ok(Some(in_use)) => {
// If model is not in use and user is an Editor, update the in use with the users session.
if in_use.latest_activity
<= (Utc::now().naive_utc() - Duration::minutes(IN_USE_DURATION_MINUTES))
{
Expand Down

0 comments on commit 1943323

Please sign in to comment.