feat(stream): implement section saving
This commit is contained in:
@@ -1,13 +1,18 @@
|
||||
package com.ddf.vodsystem.configuration;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
@Configuration
|
||||
public class AsyncConfig {
|
||||
public class AsyncConfig implements AsyncConfigurer {
|
||||
private static final Logger logger = LoggerFactory.getLogger(AsyncConfig.class);
|
||||
|
||||
@Bean(name = "ffmpegTaskExecutor")
|
||||
public Executor taskExecutor() {
|
||||
@@ -19,4 +24,10 @@ public class AsyncConfig {
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
|
||||
return (ex, method, params) ->
|
||||
logger.error("Async task '{}' failed: {}", method.getName(), ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user