- aggiornato sistema per inviare le newsletter !
This commit is contained in:
@@ -348,6 +348,7 @@ async function mystart() {
|
||||
console.log('decrypted:', decrypt);
|
||||
}
|
||||
|
||||
mycron();
|
||||
if (!process.env.DEBUG) {
|
||||
mycron();
|
||||
}
|
||||
@@ -394,14 +395,20 @@ function populateDBadmin() {
|
||||
let cfg = new CfgServer(cfgserv[0]).save();
|
||||
}
|
||||
|
||||
function mycron() {
|
||||
async function mycron() {
|
||||
|
||||
const sendemail = require('./sendemail');
|
||||
try {
|
||||
const sendemail = require('./sendemail');
|
||||
|
||||
for (const app of tools.getApps()) {
|
||||
sendemail.checkifPendingNewsletter(app.idapp);
|
||||
sendemail.checkifSentNewsletter(app.idapp);
|
||||
const arr = await tools.getApps();
|
||||
|
||||
for (const app of arr) {
|
||||
sendemail.checkifPendingNewsletter(app.idapp);
|
||||
sendemail.checkifSentNewsletter(app.idapp);
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Err mycron', e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,11 +449,11 @@ function testmsgwebpush() {
|
||||
}
|
||||
|
||||
// Cron every X minutes
|
||||
cron.schedule('*/2 * * * *', () => {
|
||||
cron.schedule('*/1 * * * *', () => {
|
||||
// console.log('Running Cron Job');
|
||||
if (!process.env.DEBUG) {
|
||||
// if (!process.env.DEBUG) {
|
||||
mycron();
|
||||
}
|
||||
// }
|
||||
});
|
||||
|
||||
// Cron every X minutes
|
||||
|
||||
Reference in New Issue
Block a user