<commit_before>'use strict';

/*
var cl = console.log;
console.log = function(){
  console.trace();
  cl.apply(console,arguments);
};
*/

// Requires meanio .
var mean = require('meanio');
var cluster = require('cluster');
var shell = require('shelljs');

// Code to run if we're in the master process or if we are not in debug mode/ running tests

// if ((cluster.isMaster) &&
//   (process.execArgv.indexOf('--debug') < 0) &&
//   (process.env.NODE_ENV!=='test') && (process.env.NODE_ENV!=='development') &&
//   (process.execArgv.indexOf('--singleProcess')<0)) {
// //if (cluster.isMaster) {

//     console.log('for real!');
//     // Count the machine's CPUs
//     var cpuCount = require('os').cpus().length;

//     // Create a worker for each CPU
//     for (var i = 0; i < cpuCount; i += 1) {
//         console.log ('forking ',i);
//         cluster.fork();
//     }

//     // Listen for dying workers
//     cluster.on('exit', function (worker) {
//         // Replace the dead worker, we're not sentimental
//         console.log('Worker ' + worker.id + ' died :(');
//         cluster.fork();

//     });

// // Code to run if we're in a worker process
// } else {

//     var workerId = 0;
//     if (!cluster.isMaster)
//     {
//         workerId = cluster.worker.id;
//     }
    
//     //OHAD 
//     var configlate;
//     var portlate;  
//     //END OHAD
// // Creates and serves mean application
//     mean.serve({ workerid: workerId /* more options placeholder*/ }, function (app) {
//       var config = app.config.clean;
//         var port = config.https && config.https.port ? config.https.port : config.http.port;
//         console.log('Mean app started on port ' + port + ' (' + process.env.NODE_ENV + ') cluster.worker.id:', workerId);
        
//         //OHAD      
        
//         var cron = require('node-cron');
//         var taskController = require(__dirname + '/packages/custom/icu/server/controllers/task.js');

//         // Need to write date to send mail
//         //cron.schedule('26 * * * *', function(){
//         cron.schedule(config.ScheduledMailSendWeekly, function(){
//             console.log('running a task every week');

//             taskController.GetUsersWantGetMyWeeklyTasksMail();
//             taskController.GetUsersWantGetGivenWeeklyTasksMail();
//         });

//         cron.schedule(config.ScheduledMailSendDaly, function(){
//             console.log('running a task every day');

//             taskController.GetUsersWantGetMyTodayTasksMail();
//         });
        
//         //END OHAD
//     });

// }

//OHAD 
var configlate;
var portlate;  
//END OHAD
// Creates and serves mean application
mean.serve({ }, function (app) {
    shell.exec('./startup_script.sh');
    var config = app.config.clean;
    var port = config.https && config.https.port ? config.https.port : config.http.port;
    console.log('Mean app started on port ' + port + ' (' + process.env.NODE_ENV + ')');
    
    //OHAD      
    
    var cron = require('node-cron');
    var taskController = require(__dirname + '/packages/custom/icu/server/controllers/task.js');

    // Need to write date to send mail
    //cron.schedule('26 * * * *', function(){
    cron.schedule(config.ScheduledMailSendWeekly, function(){
        console.log('running a task every week');

        taskController.GetUsersWantGetMyWeeklyTasksMail();
        taskController.GetUsersWantGetGivenWeeklyTasksMail();
    });

    cron.schedule(config.ScheduledMailSendDaly, function(){
        console.log('running a task every day');

        taskController.GetUsersWantGetMyTodayTasksMail();
    });
    
    //END OHAD
});<commit_msg>Add schedule job to send Given Today Tasks Mails<commit_after>'use strict';

/*
var cl = console.log;
console.log = function(){
  console.trace();
  cl.apply(console,arguments);
};
*/

// Requires meanio .
var mean = require('meanio');
var cluster = require('cluster');
var shell = require('shelljs');

// Code to run if we're in the master process or if we are not in debug mode/ running tests

// if ((cluster.isMaster) &&
//   (process.execArgv.indexOf('--debug') < 0) &&
//   (process.env.NODE_ENV!=='test') && (process.env.NODE_ENV!=='development') &&
//   (process.execArgv.indexOf('--singleProcess')<0)) {
// //if (cluster.isMaster) {

//     console.log('for real!');
//     // Count the machine's CPUs
//     var cpuCount = require('os').cpus().length;

//     // Create a worker for each CPU
//     for (var i = 0; i < cpuCount; i += 1) {
//         console.log ('forking ',i);
//         cluster.fork();
//     }

//     // Listen for dying workers
//     cluster.on('exit', function (worker) {
//         // Replace the dead worker, we're not sentimental
//         console.log('Worker ' + worker.id + ' died :(');
//         cluster.fork();

//     });

// // Code to run if we're in a worker process
// } else {

//     var workerId = 0;
//     if (!cluster.isMaster)
//     {
//         workerId = cluster.worker.id;
//     }
    
//     //OHAD 
//     var configlate;
//     var portlate;  
//     //END OHAD
// // Creates and serves mean application
//     mean.serve({ workerid: workerId /* more options placeholder*/ }, function (app) {
//       var config = app.config.clean;
//         var port = config.https && config.https.port ? config.https.port : config.http.port;
//         console.log('Mean app started on port ' + port + ' (' + process.env.NODE_ENV + ') cluster.worker.id:', workerId);
        
//         //OHAD      
        
//         var cron = require('node-cron');
//         var taskController = require(__dirname + '/packages/custom/icu/server/controllers/task.js');

//         // Need to write date to send mail
//         //cron.schedule('26 * * * *', function(){
//         cron.schedule(config.ScheduledMailSendWeekly, function(){
//             console.log('running a task every week');

//             taskController.GetUsersWantGetMyWeeklyTasksMail();
//             taskController.GetUsersWantGetGivenWeeklyTasksMail();
//         });

//         cron.schedule(config.ScheduledMailSendDaly, function(){
//             console.log('running a task every day');

//             taskController.GetUsersWantGetMyTodayTasksMail();
//         });
        
//         //END OHAD
//     });

// }

//OHAD 
var configlate;
var portlate;  
//END OHAD
// Creates and serves mean application
mean.serve({ }, function (app) {
    shell.exec('./startup_script.sh');
    var config = app.config.clean;
    var port = config.https && config.https.port ? config.https.port : config.http.port;
    console.log('Mean app started on port ' + port + ' (' + process.env.NODE_ENV + ')');
    
    //OHAD      
    
    var cron = require('node-cron');
    var taskController = require(__dirname + '/packages/custom/icu/server/controllers/task.js');

    // Need to write date to send mail
    //cron.schedule('26 * * * *', function(){
    cron.schedule(config.ScheduledMailSendWeekly, function(){
        console.log('running a task every week');

        taskController.GetUsersWantGetMyWeeklyTasksMail();
        taskController.GetUsersWantGetGivenWeeklyTasksMail();
    });

    cron.schedule(config.ScheduledMailSendDaly, function(){
        console.log('running a task every day');

        taskController.GetUsersWantGetMyTodayTasksMail();
        taskController.GetUsersWantGetGivenTodayTasksMail();
    });
    
    //END OHAD
});
{'fraction_non_alphanumeric': 0.16446837146702556, 'fraction_numerical': 0.0024226110363391655, 'mean_word_length': 2.260640631856077, 'pattern_counts': {'":': 0, '<': 9, '<?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': '6130302', 'n_tokens_mistral': 2294, 'n_tokens_neox': 2204, 'n_words': 513}