<commit_before>package store.server.async;

import static java.util.concurrent.Executors.newScheduledThreadPool;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import store.common.config.Config;
import static store.server.config.ServerConfig.ASYNC_POOL_SIZE;

/**
 * Provides periodic tasks execution service.
 */
public class AsyncService {

    private static final Logger LOG = LoggerFactory.getLogger(AsyncService.class);
    private final ScheduledExecutorService executor;

    /**
     * Constructor.
     *
     * @param config Configuration holder.
     */
    public AsyncService(Config config) {
        executor = newScheduledThreadPool(config.getInt(ASYNC_POOL_SIZE));<commit_msg>Nommage des threads de AsyncService.<commit_after>package store.server.async;

import static java.util.concurrent.Executors.defaultThreadFactory;
import static java.util.concurrent.Executors.newScheduledThreadPool;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import store.common.config.Config;
import static store.server.config.ServerConfig.ASYNC_POOL_SIZE;

/**
 * Provides periodic tasks execution service.
 */
public class AsyncService {

    private static final Logger LOG = LoggerFactory.getLogger(AsyncService.class);
    private final ScheduledExecutorService executor;

    /**
     * Constructor.
     *
     * @param config Configuration holder.
     */
    public AsyncService(Config config) {
        executor = newScheduledThreadPool(config.getInt(ASYNC_POOL_SIZE), new ThreadFactory() {
            private final ThreadFactory defaultFactory = defaultThreadFactory();
            private final AtomicInteger counter = new AtomicInteger();

            @Override
            public Thread newThread(Runnable runnable) {
                Thread thread = defaultFactory.newThread(runnable);
                thread.setName("async-service-thread-" + counter.incrementAndGet());
                return thread;
            }
        });
{'fraction_non_alphanumeric': 0.08669527896995709, 'fraction_numerical': 0.0017167381974248926, 'mean_word_length': 3.9385593220338984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '677722', 'n_tokens_mistral': 624, 'n_tokens_neox': 611, 'n_words': 131}