<commit_before>package fredboat.sharding;

import fredboat.FredBoat;
import net.dv8tion.jda.JDA;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ShardTracker extends Thread {

    private static final Logger log = LoggerFactory.getLogger(ShardTracker.class);
    public final JDA jda;
    public static ShardTracker ins = null;

    private static int globalUserCount = 0;
    private static int globalGuildCount = 0;

    private static final long TICK_TIME = 10 * 60 * 1000;//10 mins

    public ShardTracker(JDA jda, String token) {
        if (ins != null) {
            throw new IllegalStateException("Only one instance may exist.");
        }

        this.jda = jda;

        setDaemon(true);
        setName(this.getClass().getSimpleName());
        ins = this;
    }

    public static int getGlobalUserCount() {
        return globalUserCount;
    }

    public static int getGlobalGuildCount() {
        return globalGuildCount;
    }

    @Override
    public void run() {
        while (true) {
            try {
                sleep(TICK_TIME);
                tick();
            } catch (Exception ex) {
                log.error("Caught exception in ShardTracker loop", ex);
            }
        }
    }

    private void tick() {
        if(FredBoat.shardId == 0){
            globalGuildCount = FredBoatAPIClient.getGlobalGuildCountFromShards();
            globalUserCount = FredBoatAPIClient.getGlobalUserCountFromShards();
        } else {
            globalGuildCount = FredBoatAPIClient.getGlobalGuildCountFromShard0();
            globalUserCount = FredBoatAPIClient.getGlobalUserCountFromShard0();
        }
    }

}
<commit_msg>ShardTracker now starts working immediately<commit_after>package fredboat.sharding;

import fredboat.FredBoat;
import net.dv8tion.jda.JDA;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ShardTracker extends Thread {

    private static final Logger log = LoggerFactory.getLogger(ShardTracker.class);
    public final JDA jda;
    public static ShardTracker ins = null;

    private static int globalUserCount = 0;
    private static int globalGuildCount = 0;

    private static final long TICK_TIME = 10 * 60 * 1000;//10 mins

    public ShardTracker(JDA jda, String token) {
        if (ins != null) {
            throw new IllegalStateException("Only one instance may exist.");
        }

        this.jda = jda;

        setDaemon(true);
        setName(this.getClass().getSimpleName());
        ins = this;
    }

    public static int getGlobalUserCount() {
        return globalUserCount;
    }

    public static int getGlobalGuildCount() {
        return globalGuildCount;
    }

    @Override
    public void run() {
        while (true) {
            try {
                tick();
                sleep(TICK_TIME);
            } catch (Exception ex) {
                log.error("Caught exception in ShardTracker loop", ex);
            }
        }
    }

    private void tick() {
        if(FredBoat.shardId == 0){
            globalGuildCount = FredBoatAPIClient.getGlobalGuildCountFromShards();
            globalUserCount = FredBoatAPIClient.getGlobalUserCountFromShards();
        } else {
            globalGuildCount = FredBoatAPIClient.getGlobalGuildCountFromShard0();
            globalUserCount = FredBoatAPIClient.getGlobalUserCountFromShard0();
        }
    }

}

{'fraction_non_alphanumeric': 0.08431603773584906, 'fraction_numerical': 0.01061320754716981, 'mean_word_length': 2.349457058242843, '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': '3742759', 'n_tokens_mistral': 1015, 'n_tokens_neox': 974, 'n_words': 232}