mirror of https://github.com/halo-dev/halo
🔨 remove cron.setting and hutool-cron repository
parent
b69ec0313e
commit
7dbbc17c70
5
pom.xml
5
pom.xml
|
@ -147,11 +147,6 @@
|
|||
<artifactId>hutool-extra</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-cron</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 又拍云SDK -->
|
||||
<dependency>
|
||||
|
|
|
@ -6,7 +6,6 @@ import cc.ryanc.halo.service.OptionsService;
|
|||
import cc.ryanc.halo.utils.HaloUtils;
|
||||
import cc.ryanc.halo.web.controller.core.BaseController;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.cron.CronUtil;
|
||||
import freemarker.template.TemplateModelException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -14,7 +13,6 @@ import org.springframework.boot.context.event.ApplicationStartedEvent;
|
|||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -49,15 +47,6 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
|
|||
this.loadOptions();
|
||||
this.loadThemes();
|
||||
this.loadOwo();
|
||||
//启动定时任务
|
||||
// CronUtil.start();
|
||||
// log.info("The scheduled task starts successfully!");
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
public void onDestroy() {
|
||||
log.info("Destroyed the cron scheduler");
|
||||
CronUtil.stop();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
package cc.ryanc.halo.utils;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author : RYAN0UP
|
||||
* @date : 2018/12/5
|
||||
*/
|
||||
@Component
|
||||
public class SpringUtil implements ApplicationContextAware {
|
||||
|
||||
private static ApplicationContext applicationContext;
|
||||
|
||||
/**
|
||||
* 获取applicationContext
|
||||
*
|
||||
* @return ApplicationContext
|
||||
*/
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
if (SpringUtil.applicationContext == null) {
|
||||
SpringUtil.applicationContext = applicationContext;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过name获取 Bean.
|
||||
*
|
||||
* @param name name
|
||||
* @return Object
|
||||
*/
|
||||
public static Object getBean(String name) {
|
||||
return getApplicationContext().getBean(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过class获取Bean
|
||||
*
|
||||
* @param clazz clazz
|
||||
* @param <T> <T>
|
||||
* @return T
|
||||
*/
|
||||
public static <T> T getBean(Class<T> clazz) {
|
||||
return getApplicationContext().getBean(clazz);
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
cc.ryanc.halo.task.PostSyncTask.postSync = 0 0 * * * ?
|
Loading…
Reference in New Issue