Disabled debug Mongoose
Updated modules fixed tests
This commit is contained in:
@@ -15,24 +15,24 @@ const fs = require('fs');
|
||||
const port = process.env.PORT;
|
||||
|
||||
|
||||
console.log(" 2b) express");
|
||||
// console.log(" 2b) express");
|
||||
|
||||
const express = require('express');
|
||||
// console.log(" 2c) body-parser");
|
||||
const bodyParser = require('body-parser');
|
||||
const path = require('path');
|
||||
|
||||
console.log(" 3) cron");
|
||||
// console.log(" 3) cron");
|
||||
|
||||
const cron = require('node-cron');
|
||||
|
||||
console.log(" 4) mongoose");
|
||||
// console.log(" 4) mongoose");
|
||||
require('./db/mongoose');
|
||||
|
||||
console.log(" 5) settings");
|
||||
// console.log(" 5) settings");
|
||||
const { Settings } = require('./models/settings');
|
||||
|
||||
i18n = require("i18n");
|
||||
const i18n = require("i18n");
|
||||
|
||||
// console.log(" 5) key");
|
||||
|
||||
@@ -56,7 +56,7 @@ const tools = require('./tools/general');
|
||||
|
||||
require('./models/cfgserver');
|
||||
|
||||
var mongoose = require('mongoose');
|
||||
var mongoose = require('mongoose').set('debug', false)
|
||||
|
||||
mongoose.set('debug', process.env.DEBUG);
|
||||
|
||||
@@ -219,12 +219,13 @@ myLoad().then(ris => {
|
||||
|
||||
async function myLoad() {
|
||||
|
||||
return await tools.loadApps();
|
||||
return tools.loadApps();
|
||||
}
|
||||
|
||||
async function mystart() {
|
||||
|
||||
if (process.env.PROD !== 1) {
|
||||
|
||||
testmsgwebpush();
|
||||
|
||||
// tools.sendNotifToAdmin('Riparti', 'Riparti');
|
||||
@@ -240,7 +241,9 @@ async function mystart() {
|
||||
console.log('decrypted:', decrypt);
|
||||
}
|
||||
|
||||
mycron();
|
||||
if (!process.env.DEBUG) {
|
||||
mycron();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -311,7 +314,7 @@ function testmsgwebpush() {
|
||||
// console.log('nomeapp 1: ' , tools.getNomeAppByIdApp(1));
|
||||
// console.log('nomeapp 2: ' , tools.getNomeAppByIdApp(2));
|
||||
|
||||
User.find({ username: 'paoloarcnm' }).then((arrusers) => {
|
||||
User.find({ username: 'paoloar77', idapp: '1' }).then((arrusers) => {
|
||||
if (arrusers !== null) {
|
||||
for (const user of arrusers) {
|
||||
tools.sendNotificationToUser(user._id, 'Server', 'Il Server è Ripartito', '/', '', 'server', [])
|
||||
@@ -332,14 +335,17 @@ function testmsgwebpush() {
|
||||
// Cron every X minutes
|
||||
cron.schedule('*/2 * * * *', () => {
|
||||
// console.log('Running Cron Job');
|
||||
mycron();
|
||||
if (!process.env.DEBUG) {
|
||||
mycron();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Cron every X minutes
|
||||
cron.schedule('*/60 * * * *', async () => {
|
||||
|
||||
mycron_30min();
|
||||
if (!process.env.DEBUG) {
|
||||
mycron_30min();
|
||||
}
|
||||
});
|
||||
|
||||
// mycron_30min();
|
||||
|
||||
Reference in New Issue
Block a user