Skip to content
Snippets Groups Projects
Commit a90183bf authored by srosse's avatar srosse
Browse files

Merge remote-tracking branch 'origin/OpenOLAT_14.2' into OpenOLAT_15.1

parents e9f2800b 8b031ee6
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"> http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="taskExecutorManager" class="org.olat.core.commons.services.taskexecutor.manager.TaskExecutorManagerImpl"> <bean id="taskExecutorManager" class="org.olat.core.commons.services.taskexecutor.manager.TaskExecutorManagerImpl" destroy-method="shutdown">
<constructor-arg index="0" ref="mpTaskExecutorService" /> <constructor-arg index="0" ref="mpTaskExecutorService" />
<constructor-arg index="1" ref="sequentialTaskExecutorService" /> <constructor-arg index="1" ref="sequentialTaskExecutorService" />
<constructor-arg index="2" ref="lowPriorityTaskSpringExecutorService" /> <constructor-arg index="2" ref="lowPriorityTaskSpringExecutorService" />
......
...@@ -112,8 +112,9 @@ public class TaskExecutorManagerImpl implements TaskExecutorManager { ...@@ -112,8 +112,9 @@ public class TaskExecutorManagerImpl implements TaskExecutorManager {
} }
public void shutdown() { public void shutdown() {
taskExecutor.shutdown(); taskExecutor.shutdownNow();
sequentialTaskExecutor.shutdown(); sequentialTaskExecutor.shutdownNow();
lowPriorityTaskExecutor.shutdownNow();
} }
@Override @Override
......
...@@ -13,11 +13,12 @@ ...@@ -13,11 +13,12 @@
<property name="className" value="org.olat.core.util.mail.ui.SendDocumentsByEMailController"/> <property name="className" value="org.olat.core.util.mail.ui.SendDocumentsByEMailController"/>
</bean> </bean>
<bean id="mailAsyncExecutorService" class="org.springframework.core.task.support.ExecutorServiceAdapter"> <bean id="mailAsyncExecutorService" class="org.springframework.core.task.support.ExecutorServiceAdapter">
<constructor-arg index="0" ref="mailAsyncExecutor" /> <constructor-arg index="0" ref="mailAsyncExecutor" />
</bean> </bean>
<bean id="mailAsyncExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"> <bean id="mailAsyncExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="waitForTasksToCompleteOnShutdown" value="true" />
<property name="corePoolSize" value="1" /> <property name="corePoolSize" value="1" />
<property name="maxPoolSize" value="1" /> <property name="maxPoolSize" value="1" />
<property name="queueCapacity" value="2000" /> <property name="queueCapacity" value="2000" />
......
...@@ -51,6 +51,7 @@ import org.olat.course.nodes.livestream.LiveStreamService; ...@@ -51,6 +51,7 @@ import org.olat.course.nodes.livestream.LiveStreamService;
import org.olat.course.nodes.livestream.model.LiveStreamEventImpl; import org.olat.course.nodes.livestream.model.LiveStreamEventImpl;
import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryEntry;
import org.olat.repository.RepositoryEntryRef; import org.olat.repository.RepositoryEntryRef;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.CustomizableThreadFactory; import org.springframework.scheduling.concurrent.CustomizableThreadFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -62,7 +63,7 @@ import org.springframework.stereotype.Service; ...@@ -62,7 +63,7 @@ import org.springframework.stereotype.Service;
* *
*/ */
@Service @Service
public class LiveStreamServiceImpl implements LiveStreamService { public class LiveStreamServiceImpl implements LiveStreamService, DisposableBean {
private static final Logger log = Tracing.createLoggerFor(LiveStreamServiceImpl.class); private static final Logger log = Tracing.createLoggerFor(LiveStreamServiceImpl.class);
...@@ -84,6 +85,13 @@ public class LiveStreamServiceImpl implements LiveStreamService { ...@@ -84,6 +85,13 @@ public class LiveStreamServiceImpl implements LiveStreamService {
return scheduler; return scheduler;
} }
@Override
public void destroy() throws Exception {
if(scheduler != null) {
scheduler.shutdownNow();
}
}
@Override @Override
public List<? extends LiveStreamEvent> getRunningEvents(CourseCalendars calendars, int bufferBeforeMin, public List<? extends LiveStreamEvent> getRunningEvents(CourseCalendars calendars, int bufferBeforeMin,
int bufferAfterMin) { int bufferAfterMin) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment