#define XERR "cron"
#include "cron.ih"

// called once a minute, checking whether jobs should be added to the queue

    // by parentprocess.cc

Cron::EntryVect Cron::cronJobs() 
{
    DateTime now(DateTime::LOCALTIME);

    EntryVect ret;

    lock_guard _{ d_mutex };

    for (CronEntry const &entry: d_cronData.cronEntries())
    {
        if (add(entry, now))      // maybe add &entry to the queue 
            ret.push_back(&entry);
    }

    return ret;
}
