def updateCheckExpired()

in app/models/ServerTokenEntry.scala [15:38]


  def updateCheckExpired(maxUses:Option[Int]=None):ServerTokenEntry = {
    val firstCheck = expiry match {
      case Some(actualExpiry) =>
        if (actualExpiry.isBefore(ZonedDateTime.now())) {
          this.copy(expired = true)
        } else {
          this
        }
      case None=>
        this
    }

    if(firstCheck==this){
      maxUses match {
        case Some(maxUsesValue)=>
          if(uses>=maxUsesValue){
            this.copy(expired = true)
          } else {
            this
          }
        case None=>this
      }
    } else firstCheck
  }