<commit_before>
var logger = require('_pr/logger')(module);
var CatalystCronJob = require('_pr/cronjobs/CatalystCronJob');
var MasterUtils = require('_pr/lib/utils/masterUtil.js');
var credentialCrpto = require('_pr/lib/credentialcryptography.js');
var instancesDao = require('_pr/model/classes/instance/instance');
var containerDao = require('_pr/model/container');
var SSH = require('_pr/lib/utils/sshexec');
var fileIo = require('_pr/lib/utils/fileio');
var toPairs = require('lodash.topairs');
var async = require('async');

var DockerContainerSync = Object.create(CatalystCronJob);
DockerContainerSync.interval = '* * * * *';
DockerContainerSync.execute = sync;

module.exports = DockerContainerSync;

function sync() {
    var cmd = 'echo -e \"GET /containers/json?all=1 HTTP/1.0\r\n\" | sudo nc -U /var/run/docker.sock';
    async.waterfall([
            function(next){
                MasterUtils.getAllActiveOrg(next);
            },
            function(orgs,next) {
                async.forEach(orgs, function (organization, next) {
                    MasterUtils.getBusinessGroupsByOrgId(organization.rowid, function (err, businessGroups) {
                        if (err) {
                            logger.error(err);
                            return;
                        };
                        async.forEach(businessGroups, function (businessGroup, next) {
                            MasterUtils.getProjectsBybgId(businessGroup.rowid, function (err, projects) {
                                if (err) {
                                    logger.error(err);
                                    return;
                                };
                                async.forEach(projects, function (project, next) {
                                    MasterUtils.getEnvironmentsByprojectId(project.rowid, function (err, environments) {
                                        if (err) {
                                            logger.error(err);
                                            return;
                                        };
                                        if (environments.length > 0) {
                                            async.forEach(environments, function (environment, next) {
                                                var jsonData = {
                                                    orgId: organization.rowid,
                                                    bgId: businessGroup.rowid,
                                                    projectId: project.rowid,
                                                    envId: environment.rowid
                                                };
                                                instancesDao.getInstancesByOrgBgProjectAndEnvIdForDocker(jsonData, function (err, instances) {
                                                    if (err) {
                                                        logger.error(err);
                                                        return;<commit_msg>Sync docker container job with dev<commit_after>
var logger = require('_pr/logger')(module);
var CatalystCronJob = require('_pr/cronjobs/CatalystCronJob');
var MasterUtils = require('_pr/lib/utils/masterUtil.js');
var credentialCrpto = require('_pr/lib/credentialcryptography.js');
var instancesDao = require('_pr/model/classes/instance/instance');
var containerDao = require('_pr/model/container');
var SSH = require('_pr/lib/utils/sshexec');
var fileIo = require('_pr/lib/utils/fileio');
var toPairs = require('lodash.topairs');
var async = require('async');

var DockerContainerSync = Object.create(CatalystCronJob);
DockerContainerSync.interval = '* * * * *';
DockerContainerSync.execute = sync;

module.exports = DockerContainerSync;

function sync() {
    var cmd = 'echo -e \"GET /containers/json?all=1 HTTP/1.0\r\n\" | sudo nc -U /var/run/docker.sock';
    async.waterfall([
            function(next){
                MasterUtils.getAllActiveOrg(next);
            },
            function(orgs,next) {
                async.forEach(orgs, function (organization, next) {
                    MasterUtils.getBusinessGroupsByOrgId(organization.rowid, function (err, businessGroups) {
                        if (err) {
                            logger.error(err);
                            return;
                        };
                        async.forEach(businessGroups, function (businessGroup, next) {
                            MasterUtils.getProjectsBybgId(businessGroup.rowid, function (err, projects) {
                                if (err) {
                                    logger.error(err);
                                    return;
                                };
                                async.forEach(projects, function (project, next) {
                                    MasterUtils.getEnvironmentsByprojectId(project.rowid, function (err, environments) {
                                        if (err) {
                                            logger.error(err);
                                            return;
                                        };
                                        if (environments.length > 0) {
                                            async.forEach(environments, function (environment, next) {
                                                var jsonData = {
                                                    orgId: organization.rowid,
                                                    bgId: businessGroup.rowid,
                                                    projectId: project.rowid,
                                                    envId: environment.rowid
                                                };
                                                instancesDao.getInstancesByOrgBgProjectAndEnvId(jsonData, function (err, instances) {
                                                    if (err) {
                                                        logger.error(err);
                                                        return;
{'fraction_non_alphanumeric': 0.08789767136766152, 'fraction_numerical': 0.0013119055428009183, 'mean_word_length': 1.0987611837577427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 70, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2275904', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1247, 'n_words': 238}