Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/main/java/com/iexec/core/task/TaskService.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2025 IEXEC BLOCKCHAIN TECH
* Copyright 2020-2026 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -86,9 +86,10 @@ public TaskService(MongoTemplate mongoTemplate,

@PostConstruct
void init() {
final ExecutorService taskStatusesCountExecutor = Executors.newSingleThreadExecutor();
taskStatusesCountExecutor.submit(this::initializeCurrentTaskStatusesCount);
taskStatusesCountExecutor.shutdown();
try (final ExecutorService taskStatusesCountExecutor = Executors.newSingleThreadExecutor()) {
taskStatusesCountExecutor.submit(this::initializeCurrentTaskStatusesCount);
taskStatusesCountExecutor.shutdown();
}
}

/**
Expand Down