Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1400#discussion_r98362729
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/reporting/AbstractReportingTaskNode.java
 ---
    @@ -72,6 +77,27 @@ public AbstractReportingTaskNode(final ReportingTask 
reportingTask, final String
             this.reportingTask = reportingTask;
             this.processScheduler = processScheduler;
             this.serviceLookup = controllerServiceProvider;
    +
    +        final Class<?> reportingClass = reportingTask.getClass();
    +
    +        try {
    +            if (reportingClass.isAnnotationPresent(DefaultSchedule.class)) 
{
    +                DefaultSchedule dsc = 
reportingClass.getAnnotation(DefaultSchedule.class);
    +                try {
    +                    this.setSchedulingStrategy(dsc.strategy());
    +                } catch (Throwable ex) {
    +                    LOG.error(String.format("Error while setting 
scheduling strategy from DefaultSchedule annotation: %s", ex.getMessage()), ex);
    +                }
    +                try {
    +                    this.setSchedulingPeriod(dsc.period());
    +                } catch (Throwable ex) {
    +                    
this.setSchedulingStrategy(SchedulingStrategy.TIMER_DRIVEN);
    +                    LOG.error(String.format("Error while setting 
scheduling period from DefaultSchedule annotation: %s", ex.getMessage()), ex);
    +                }
    +            }
    +        } catch (Throwable ex) {
    +            LOG.error(String.format("Error while setting default schedule 
from DefaultSchedule annotation: %s",ex.getMessage()),ex);
    --- End diff --
    
    Correct, removed unnecessary try/catch.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to