Suppression de certains logs/notifications devenues inutiles
This commit is contained in:
parent
cadbe919f0
commit
1aec18a210
@ -376,8 +376,6 @@ exports.checkQuestionnairesNeedToBePublished= async (req, res, next) =>
|
||||
if(nb > 0)
|
||||
creaNewQuestionnairesJson();// provoque mise à jour du HTLM, RSS, etc.
|
||||
res.status(200).json(txtQuestionnaire.haveBeenPublished.replace(":NB", nb));
|
||||
console.log(txtQuestionnaire.haveBeenPublished.replace(":NB", nb));
|
||||
await toolMail.sendMail(0, config.adminEmail, "Publication articles", txtQuestionnaire.haveBeenPublished.replace(":NB", nb), "<p>"+txtQuestionnaire.haveBeenPublished.replace(":NB", nb)+"</p>");
|
||||
next();
|
||||
}
|
||||
catch(e)
|
||||
@ -562,8 +560,6 @@ const checkQuestionnairesPublishedHaveHTML = async (regenerate=false) =>
|
||||
else if(await toolFile.checkIfFileExist(config.dirHTMLQuestionnaire, questionnaires[i].slug+".html")===false)
|
||||
{
|
||||
await creaQuestionnaireHTML(questionnaires[i].id);
|
||||
console.log("je viens de publier le questionnaire :"+questionnaires[i].slug);
|
||||
await toolMail.sendMail(0, config.adminEmail, "Publication d'un article", "Je viens de publier le quiz : "+config.siteUrl+"/quizs/"+questionnaires[i].slug+".html", "<p>Je viens de publier le quiz : "+config.siteUrl+"/quizs/"+questionnaires[i].slug+".html</p>");
|
||||
nb++;
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,6 @@ exports.notifyExpirationFreeAccount= async(req, res, next) =>
|
||||
const db = require("../models/index");
|
||||
const dateExpirationMin=new Date(new Date().getTime()-(config.freeAccountTimingInDays-config.freeAccountExpirationNotificationInDays+1)*24*3600*1000);
|
||||
const dateExpirationMax=new Date(new Date().getTime()-(config.freeAccountTimingInDays-config.freeAccountExpirationNotificationInDays)*24*3600*1000);
|
||||
console.log("je cherche les utilisateurs freemium dont l'abonnement a été créé entre le "+dateExpirationMin+" et le "+dateExpirationMax+".");
|
||||
const users=await db["Subscription"].findAll(
|
||||
{
|
||||
where:
|
||||
@ -186,13 +185,9 @@ exports.addNewQuestionnaireUsers = async(req, res, next) =>
|
||||
// Le tout en heure locale et en ignorant ceux qui ont déjà été servis ce jour.
|
||||
const subscriptionsOk = await db.sequelize.query("SELECT `Subscriptions`.`id` as SubscriptionId, `UserId`, `name`, `email`, `smtp`, `language`, `noticeOk`, `receiptDays`, ADDDATE(UTC_TIMESTAMP, INTERVAL `timeDifference` MINUTE) AS localDate FROM `Subscriptions` INNER JOIN `Users` ON `Subscriptions`.`UserId`=`Users`.`id` WHERE `status`='user' AND ADDDATE(`Subscriptions`.`createdAt`, `numberOfDays`) > UTC_TIMESTAMP HAVING HOUR(localDate) > "+config.hourGiveNewQuestionnaireBegin+" AND HOUR(localDate) < "+config.hourGiveNewQuestionnaireEnd+" AND LOCATE(DAYOFWEEK(localDate),receiptDays)!=0 AND SubscriptionId NOT IN (SELECT DISTINCT `SubscriptionId` FROM `Pauses` WHERE ADDDATE(`startingAt`, INTERVAL `timeDifference` MINUTE) <= localDate AND ADDDATE(`endingAT`, INTERVAL `timeDifference` MINUTE) > localDate) AND `UserId` NOT IN (SELECT DISTINCT `UserId` FROM `QuestionnaireAccesses` WHERE DATEDIFF(NOW(),`createdAt`) < 1 AND `selfCreatedOk` = false) LIMIT "+config.numberNewQuestionnaireAtSameTime, { type: QueryTypes.SELECT });
|
||||
if(subscriptionsOk.length===0)
|
||||
{
|
||||
res.status(200).json({ message: txt.allSubscriptionProcessed });
|
||||
//console.log(txt.allSubscriptionProcessed);
|
||||
}
|
||||
else
|
||||
{
|
||||
await toolMail.sendMail(0, config.adminEmail, "Abonnements à traiter", subscriptionsOk.length+" abonnements à traiter.", "<p>"+subscriptionsOk.length+" abonnements à traiter.</p>");
|
||||
let newQuestionnaire, access, questionnaire, token;
|
||||
for (let i in subscriptionsOk)
|
||||
{
|
||||
@ -237,7 +232,6 @@ exports.addNewQuestionnaireUsers = async(req, res, next) =>
|
||||
}
|
||||
}
|
||||
res.status(200).json(subscriptionsOk);
|
||||
console.log(subscriptionsOk);
|
||||
}
|
||||
next();
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ const path = require('path');
|
||||
|
||||
module.exports =
|
||||
{
|
||||
mode: "production", // pour tester les fichiers en version compressée
|
||||
mode: "development",
|
||||
devtool: "inline-source-map",
|
||||
entry:
|
||||
{
|
||||
@ -25,7 +25,7 @@ module.exports =
|
||||
},
|
||||
output:
|
||||
{
|
||||
filename: "./JS/prod/[name].app.js",
|
||||
filename: "./JS/[name].app.js",
|
||||
path: path.resolve(__dirname, "public")
|
||||
},
|
||||
module:
|
||||
|
Loading…
Reference in New Issue
Block a user