<commit_before>let SunCalc = Npm.require('suncalc');
let log = new BolideLog({category: "plugin", module:"Flux"});
Meteor.startup(function() {
    let lightState = new LightState("flux",4000);
    log.info("Plugin started");
    Meteor.setInterval(function(){
        try {
            const settings = PluginSettings.findOne("Flux");
            if(!settings){
                log.info("Not configured.");
            }
            let {latitude, longitude} = settings.location;
            var times = SunCalc.getTimes(new Date(), latitude, longitude);
            let {sunrise, sunset} = times;
            settings.times = {sunrise, sunset};
            Meteor.call('updateSetting','Flux', settings);
            log.info("Updated Times");
        }
        catch(e){
            console.log(e);
            log.error("Resetting plugin data");<commit_msg>exit if flux isn't configured<commit_after>let SunCalc = Npm.require('suncalc');
let log = new BolideLog({category: "plugin", module:"Flux"});
Meteor.startup(function() {
    let lightState = new LightState("flux",4000);
    log.info("Plugin started");
    Meteor.setInterval(function(){
        try {
            const settings = PluginSettings.findOne("Flux");
            if(!settings){
                log.info("Not configured.");
                return;
            }
            let {latitude, longitude} = settings.location;
            var times = SunCalc.getTimes(new Date(), latitude, longitude);
            let {sunrise, sunset} = times;
            settings.times = {sunrise, sunset};
            Meteor.call('updateSetting','Flux', settings);
            log.info("Updated Times");
        }
        catch(e){
            console.log(e);
            log.error("Resetting plugin data");
{'fraction_non_alphanumeric': 0.13993174061433447, 'fraction_numerical': 0.004550625711035267, 'mean_word_length': 2.2574074074074075, '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': '6060116', 'n_tokens_mistral': 498, 'n_tokens_neox': 465, 'n_words': 104}