chibenwa commented on code in PR #1463:
URL: https://github.com/apache/james-project/pull/1463#discussion_r1117061146
##########
server/mailet/rate-limiter/src/main/scala/org/apache/james/transport/mailets/EntityType.scala:
##########
@@ -48,62 +49,48 @@ object ConfigurationOps {
def getOptionalSize(key: String): Option[org.apache.james.util.Size] =
mailetConfig.getOptionalString(key)
.map {
case "" => throw new IllegalArgumentException(s"'$key' field cannot be
empty if specified")
- case s => s
+ case s => s
}
.map(org.apache.james.util.Size.parse)
}
}
+object EntityType {
+ def extractRules(entityType: EntityType, duration: Duration, mailetConfig:
MailetConfig): Option[Rules] = (entityType match {
+ case Count => mailetConfig.getOptionalLong("count")
+ case RecipientsType => mailetConfig.getOptionalLong("recipients")
Review Comment:
```suggestion
case Recipients => mailetConfig.getOptionalLong("recipients")
```
While we are at it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]