You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/10/08 02:31:13 UTC

[GitHub] [shardingsphere-elasticjob] jbgzz commented on issue #2106: The updated job cron configuration does not take effect

jbgzz commented on issue #2106:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2106#issuecomment-1272202582

   `	public void updateJobConfiguration(JobConfigurationPOJO jobConfiguration){
           jobConfigurationAPI.updateJobConfiguration(jobConfiguration);
       }
   
       @Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000L,multiplier = 2))
       public void updateJobConfigurationCron(String taskId, boolean isPlusOneDay){
   
           String cron = getCron(String.valueOf(now.getYear()), "?", String.valueOf(now.getMonthValue())
                   , isPlusOneDay ? String.valueOf(now.plusDays(1).getDayOfMonth()) : String.valueOf(now.getDayOfMonth()), String.valueOf(now.getHour())
                   , String.valueOf(now.getMinute() + randomMinute), String.valueOf(now.getSecond() + randomSecond));
           JobConfigurationPOJO jobConfiguration = getJobConfiguration(taskId);
           jobConfiguration.setCron(cron);
           updateJobConfiguration(jobConfiguration);
       }`
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org