<commit_before>package com.github.k0kubun.gitstar_ranking

import com.github.k0kubun.gitstar_ranking.config.Config
import kotlin.jvm.JvmStatic
import io.sentry.Sentry
import java.util.concurrent.ScheduledExecutorService
import com.github.k0kubun.gitstar_ranking.worker.WorkerManager
import java.lang.Thread
import com.google.common.util.concurrent.ThreadFactoryBuilder
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
import java.util.concurrent.BlockingQueue
import java.lang.InterruptedException
import com.github.k0kubun.gitstar_ranking.worker.UpdateUserWorker
import com.github.k0kubun.gitstar_ranking.worker.UserRankingWorker
import com.github.k0kubun.gitstar_ranking.worker.UserStarScanWorker
import com.github.k0kubun.gitstar_ranking.worker.UserFullScanWorker
import java.util.concurrent.ExecutorService
import org.slf4j.LoggerFactory

object Main {
    private val LOG = LoggerFactory.getLogger(Main::class.java)
    private const val NUM_UPDATE_USER_WORKERS = 2
    private val config = Config(System.getenv())
    @JvmStatic
    fun main(args: Array<String>) {
        Sentry.init(System.getenv()["SENTRY_DSN"])
        val scheduler = buildAndRunScheduler()
        val workers = buildWorkers(config)
        workers.start()
        Runtime.getRuntime().addShutdownHook(Thread {
            shutdownAndAwaitTermination(scheduler)
            workers.stop()
        })
    }

    private fun buildAndRunScheduler(): ScheduledExecutorService {
        val threadFactory = ThreadFactoryBuilder()
            .setNameFormat("scheduler-%d")
            .setUncaughtExceptionHandler { _: Thread?, e: Throwable -><commit_msg>Stop calling Sentry explicitly<commit_after>package com.github.k0kubun.gitstar_ranking

import com.github.k0kubun.gitstar_ranking.config.Config
import kotlin.jvm.JvmStatic
import io.sentry.Sentry
import java.util.concurrent.ScheduledExecutorService
import com.github.k0kubun.gitstar_ranking.worker.WorkerManager
import java.lang.Thread
import com.google.common.util.concurrent.ThreadFactoryBuilder
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
import java.util.concurrent.BlockingQueue
import java.lang.InterruptedException
import com.github.k0kubun.gitstar_ranking.worker.UpdateUserWorker
import com.github.k0kubun.gitstar_ranking.worker.UserRankingWorker
import com.github.k0kubun.gitstar_ranking.worker.UserStarScanWorker
import com.github.k0kubun.gitstar_ranking.worker.UserFullScanWorker
import java.util.concurrent.ExecutorService
import org.slf4j.LoggerFactory

object Main {
    private val LOG = LoggerFactory.getLogger(Main::class.java)
    private const val NUM_UPDATE_USER_WORKERS = 2
    private val config = Config(System.getenv())
    @JvmStatic
    fun main(args: Array<String>) {
        val scheduler = buildAndRunScheduler()
        val workers = buildWorkers(config)
        workers.start()
        Runtime.getRuntime().addShutdownHook(Thread {
            shutdownAndAwaitTermination(scheduler)
            workers.stop()
        })
    }

    private fun buildAndRunScheduler(): ScheduledExecutorService {
        val threadFactory = ThreadFactoryBuilder()
            .setNameFormat("scheduler-%d")
            .setUncaughtExceptionHandler { _: Thread?, e: Throwable ->
{'fraction_non_alphanumeric': 0.08424908424908426, 'fraction_numerical': 0.005494505494505495, 'mean_word_length': 4.470784641068447, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3834969', 'n_tokens_mistral': 974, 'n_tokens_neox': 955, 'n_words': 158}