Commit ada6fd6fc1d66aa94ce4e0f56093e8a7c48ed3a9
1 parent
9b7d0aac
直播申请、点播添加异步注解、修改点播送审时间
Showing
3 changed files
with
7 additions
and
1 deletions
src/main/java/com/cnlive/shenhe/ShenheApplication.java
| ... | ... | @@ -19,6 +19,7 @@ import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerF |
| 19 | 19 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| 20 | 20 | import org.springframework.context.annotation.Bean; |
| 21 | 21 | import org.springframework.context.annotation.Configuration; |
| 22 | +import org.springframework.scheduling.annotation.EnableAsync; | |
| 22 | 23 | import org.springframework.stereotype.Controller; |
| 23 | 24 | import tk.mybatis.spring.annotation.MapperScan; |
| 24 | 25 | |
| ... | ... | @@ -29,6 +30,7 @@ import java.util.Map; |
| 29 | 30 | |
| 30 | 31 | @SpringBootApplication |
| 31 | 32 | @MapperScan(basePackages = {"com.cnlive.shenhe.mapper"}) |
| 33 | +@EnableAsync | |
| 32 | 34 | public class ShenheApplication extends SpringBootServletInitializer { |
| 33 | 35 | /** |
| 34 | 36 | * url的前缀 | ... | ... |
src/main/java/com/cnlive/shenhe/job/LiveApplyJob.java
| ... | ... | @@ -16,6 +16,7 @@ import org.slf4j.Logger; |
| 16 | 16 | import org.slf4j.LoggerFactory; |
| 17 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| 18 | 18 | import org.springframework.beans.factory.annotation.Value; |
| 19 | +import org.springframework.scheduling.annotation.Async; | |
| 19 | 20 | import org.springframework.scheduling.annotation.Scheduled; |
| 20 | 21 | import org.springframework.stereotype.Component; |
| 21 | 22 | import tk.mybatis.mapper.entity.Example; |
| ... | ... | @@ -29,6 +30,7 @@ import java.util.Map; |
| 29 | 30 | * @author Administrator |
| 30 | 31 | */ |
| 31 | 32 | @Component |
| 33 | +@Async | |
| 32 | 34 | public class LiveApplyJob { |
| 33 | 35 | |
| 34 | 36 | private static Logger logger = LoggerFactory.getLogger(LiveApplyJob.class); | ... | ... |
src/main/java/com/cnlive/shenhe/job/VideosJob.java
| ... | ... | @@ -7,6 +7,7 @@ import com.cnlive.shenhe.utils.CommonConstStates; |
| 7 | 7 | import org.slf4j.Logger; |
| 8 | 8 | import org.slf4j.LoggerFactory; |
| 9 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | +import org.springframework.scheduling.annotation.Async; | |
| 10 | 11 | import org.springframework.scheduling.annotation.Scheduled; |
| 11 | 12 | import org.springframework.stereotype.Component; |
| 12 | 13 | |
| ... | ... | @@ -16,6 +17,7 @@ import java.util.List; |
| 16 | 17 | * @author Administrator |
| 17 | 18 | */ |
| 18 | 19 | @Component |
| 20 | +@Async | |
| 19 | 21 | public class VideosJob { |
| 20 | 22 | |
| 21 | 23 | private static Logger logger = LoggerFactory.getLogger(VideosJob.class); |
| ... | ... | @@ -49,7 +51,7 @@ public class VideosJob { |
| 49 | 51 | * 机审 、未审核 、抽帧完成 进行送审 |
| 50 | 52 | * 每天8点到23点执行,每分钟一次 |
| 51 | 53 | */ |
| 52 | - @Scheduled(cron = "0 0/1 8-23 * * ? ") | |
| 54 | + @Scheduled(cron = "0 0/3 8-23 * * ? ") | |
| 53 | 55 | public void videofilter() { |
| 54 | 56 | ShyVideos shyVideos = new ShyVideos(); |
| 55 | 57 | //审核类型为机审 | ... | ... |