<commit_before>package org.sagebionetworks.bridge.services;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;

public class ScheduleChangeListener implements ApplicationListener<ApplicationEvent>, BeanFactoryAware {
    
    private ExecutorService executor = Executors.newFixedThreadPool(3); //.newSingleThreadExecutor();
    private BeanFactory beanFactory;
    
    public void setBeanFactory(BeanFactory beanFactory) {
        this.beanFactory = beanFactory;
    }
    
    public void destroy() {
        executor.shutdown();
    }
    
    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        try {
            ScheduleChangeWorker worker = beanFactory.getBean("scheduleChangeWorker", ScheduleChangeWorker.class);
            worker.setApplicationEvent(event);
            executor.submit(new FutureTask<Boolean>(worker));
        } catch(Throwable t) {
            throw new RuntimeException(t);
        }
    }
}
<commit_msg>Disabling multi-threading while schedules are not updating on development<commit_after>package org.sagebionetworks.bridge.services;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;

/**
 * The executor/threading stuff works for sure on local, but I cannot verify it is working
 * on development. Removing for the time-being. -- alxdark
 */
public class ScheduleChangeListener implements ApplicationListener<ApplicationEvent>, BeanFactoryAware {
    
    // private ExecutorService executor = Executors.newFixedThreadPool(3); //.newSingleThreadExecutor();
    private BeanFactory beanFactory;
    
    public void setBeanFactory(BeanFactory beanFactory) {
        this.beanFactory = beanFactory;
    }
    
    public void destroy() {
        // executor.shutdown();
    }
    
    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        try {
            ScheduleChangeWorker worker = beanFactory.getBean("scheduleChangeWorker", ScheduleChangeWorker.class);
            worker.setApplicationEvent(event);
            // executor.submit(new FutureTask<Boolean>(worker));
            worker.call();
        } catch(Throwable t) {
            throw new RuntimeException(t);
        }
    }
}

{'fraction_non_alphanumeric': 0.08417630057803469, 'fraction_numerical': 0.000722543352601156, 'mean_word_length': 3.7495711835334475, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '258341', 'n_tokens_mistral': 690, 'n_tokens_neox': 684, 'n_words': 148}