chibenwa commented on code in PR #1264:
URL: https://github.com/apache/james-project/pull/1264#discussion_r1002829190


##########
third-party/rspamd/src/main/java/org/apache/james/rspamd/task/RunningOptions.java:
##########
@@ -66,27 +66,19 @@ public boolean test(MessageResult messageResult) {
     public static final Duration DEFAULT_RSPAMD_TIMEOUT = 
Duration.ofSeconds(15);
     public static final double DEFAULT_SAMPLING_PROBABILITY = 1;
     public static final Optional<Boolean> ALL_MESSAGES = Optional.empty();
-    public static final RunningOptions DEFAULT = new 
RunningOptions(DEFAULT_PERIOD, DEFAULT_MESSAGES_PER_SECOND, 
DEFAULT_SAMPLING_PROBABILITY, ALL_MESSAGES, DEFAULT_RSPAMD_TIMEOUT);
+    public static final RunningOptions DEFAULT = new 
RunningOptions(DEFAULT_PERIOD, DEFAULT_MESSAGES_PER_SECOND, 
DEFAULT_SAMPLING_PROBABILITY, ALL_MESSAGES, 
Optional.of(DEFAULT_RSPAMD_TIMEOUT));
 
     private final Optional<Long> periodInSecond;
     private final int messagesPerSecond;
     private final double samplingProbability;
     private final Optional<Boolean> classifiedAsSpam;
-    private final Duration rspamdTimeout;
-
-    public RunningOptions(Optional<Long> periodInSecond,
-                          int messagesPerSecond,
-                          double samplingProbability,
-                          Optional<Boolean> classifiedAsSpam) {
-        this(periodInSecond, messagesPerSecond, samplingProbability, 
classifiedAsSpam, DEFAULT_RSPAMD_TIMEOUT);
-    }
-
+    private final Optional<Duration> rspamdTimeout;
 
     public RunningOptions(@JsonProperty("periodInSecond") Optional<Long> 
periodInSecond,
                           @JsonProperty("messagesPerSecond") int 
messagesPerSecond,
                           @JsonProperty("samplingProbability") double 
samplingProbability,
                           @JsonProperty("classifiedAsSpam") Optional<Boolean> 
classifiedAsSpam,
-                          @JsonProperty("rspamdTimeoutInSeconds") Duration 
rspamdTimeout) {
+                          @JsonProperty("rspamdTimeoutInSeconds") 
Optional<Duration> rspamdTimeout) {

Review Comment:
   I do not think we do need to have this optionalin the running Options.
   
   In the end, we will always choose a timeout, thus it needs to be explicit 
here.



-- 
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]

Reply via email to