QuartzCustomizerConfig.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2018-2025, hnqz All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the pig4cloud.com developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: hnqz
  16. */
  17. package net.yyc.quartz.config;
  18. import org.springframework.boot.autoconfigure.quartz.SchedulerFactoryBeanCustomizer;
  19. import org.springframework.context.annotation.Configuration;
  20. import org.springframework.scheduling.quartz.SchedulerFactoryBean;
  21. /**
  22. * @author 郑健楠
  23. */
  24. @Configuration
  25. public class QuartzCustomizerConfig implements SchedulerFactoryBeanCustomizer {
  26. @Override
  27. public void customize(SchedulerFactoryBean schedulerFactoryBean) {
  28. schedulerFactoryBean.setWaitForJobsToCompleteOnShutdown(true);
  29. }
  30. }