<commit_before>var lang = require('../lang.js');
var config  =  require('../config.js');
var fieldValidator = require('../libs/field_validator');
var microtime = require('microtime');
//Presets
var lang = new lang();
var rlang = lang.returnMessage;

module.exports = function(app, my){
    app.post('/api/query/machine/', function(req, res){
        if(!req.body.lang){
            return res.send({"status": "error", "code":1 ,"message": 'Blank Language'});
        }else{
            var lang = req.body.lang;
        }
        var rsp = global.userManager.checkUserLogin(req.body.token, res, lang);
        if(rsp == 'exit'){
            return false;
        }
        if(req.body.token && rsp){
        	if(){
        		
        	}
            my.query('SELECT * FROM 4h_machines WHERE id_user=?', global.loggedUsers.get(token).id_user, function (error, own_machine, fields) {
                if (error) {
                    console.log(error);
                    return res.send({"status": "error", "code":15 ,"message": rlang(lang, 15)});
                }else{
                    money = result[0].money;
                    return res.send({"status": "success", "balance": money});
                }
            });
        }else{
            return res.send({"status": "error", "code":16 ,"message": rlang(lang, 16)});
        }
    });

}
<commit_msg>Actions check fix<commit_after>var config  =  require('../config.js');
var microtime = require('microtime');

var ActionsCheck = function() {
    var checkTask;
    var userlistCheck = function(){
        console.log('User cleaner started.. By ActionsCheck');
        for (var user of global.loggedUsers.values()) {
            if(user.minute_actions > config.expiration.minute_actions){
                global.loggedUsers.delete(user.token);
                console.log('User with token: '+user.token+' has been disconnected.. by ActionsCheck with reason: Max Minute Actions');
            }else{
                global.loggedUsers.get(user.token).minute_actions = 0;
            }
        }
    }
    this.startTask = function(){
        checkTask = setInterval(userlistCheck, config.tasks.actions_check);
    }
}
module.exports = new ActionsCheck();
{'fraction_non_alphanumeric': 0.15200721695985567, 'fraction_numerical': 0.005412719891745603, 'mean_word_length': 2.17310443490701, 'pattern_counts': {'":': 11, '<': 3, '<?xml version=': 0, '>': 4, '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': '4516953', 'n_tokens_mistral': 663, 'n_tokens_neox': 630, 'n_words': 140}