[ 
https://issues.apache.org/jira/browse/GOBBLIN-1880?focusedWorklogId=876610&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-876610
 ]

ASF GitHub Bot logged work on GOBBLIN-1880:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Aug/23 17:51
            Start Date: 16/Aug/23 17:51
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3742:
URL: https://github.com/apache/gobblin/pull/3742#discussion_r1296248584


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/scheduler/GobblinServiceJobScheduler.java:
##########
@@ -291,6 +291,10 @@ private boolean addSpecHelperMethod(Spec spec) {
    */
   @VisibleForTesting
   public static boolean isWithinRange(String cronExpression, int 
maxNumDaysToScheduleWithin) {
+    if (cronExpression == null || cronExpression.trim().isEmpty()) {
+      // If the cron expression is empty or null, return true to capture adhoc 
flows
+      return true;
+    }

Review Comment:
   at the core, I understand why we don't continue w/ `cronExpression == 
null`... but is this really happening?  more canonical would be to have callers 
avoid calling this w/ `null`.  then add enforcement here via `Preconditions` 
that croaks if `null` is passed in.



##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/scheduler/GobblinServiceJobScheduler.java:
##########
@@ -291,6 +291,10 @@ private boolean addSpecHelperMethod(Spec spec) {
    */
   @VisibleForTesting
   public static boolean isWithinRange(String cronExpression, int 
maxNumDaysToScheduleWithin) {
+    if (cronExpression == null || cronExpression.trim().isEmpty()) {
+      // If the cron expression is empty or null, return true to capture adhoc 
flows
+      return true;
+    }

Review Comment:
   at the core, I understand why we don't continue w/ `cronExpression == 
null`... but is this really happening?  more canonical would be to have callers 
avoid calling this w/ `null`.  then add enforcement here via `Preconditions` 
that croaks when `null` is passed in.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 876610)
    Time Spent: 0.5h  (was: 20m)

> Handle Invalid Cron Schedules for Gobblin Scheduler
> ---------------------------------------------------
>
>                 Key: GOBBLIN-1880
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1880
>             Project: Apache Gobblin
>          Issue Type: New Feature
>            Reporter: Meeth Gala
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to