locked
setInterval working in local host server but not working in azure RRS feed

  • Question

  • setInterval(async function check() {
    if ((date.getDate() == 25)
    //&& (date.getHours() == 19)
    // && (date.getMinutes() == 20) && (date.getSeconds() == 00)
    ) {
    await Drawings.find({}).then((data) => {
    data.sort(function (a, b) {
    return b.stars - a.stars;
    })
    if (data == null) {
    return;
    }
    AllDrawings.updateMany({ "potmCurrentWinner": true }, { $set: { "potmCurrentWinner": false } }, async function (err) {
    if (err) {
    return;
    }
    // move the drawing to potm
    await AllDrawings.updateOne({ "DrawingName": data[0]['DrawingName'] }, {
    $set: {
    "potmCurrentWinner": true,
    "potm": true
    }
    }, async function (err) {
    //move file
    await User.updateOne({ userName: data[0].Drawer },
    { $inc: { stars: 25 } })
    console.log("done3");
    await User.updateOne({ userName: data[0].Drawer },
    { $inc: { drawingOfTheMonth: 1 } });
    //delete all drawwing the u give star
    await User.updateMany({},
    { $set: { drawingThatGotYourStar: [] } });
    await Drawings.deleteMany({});
    console.log("done4");
    });
    });
    })
    }
    }
    , 1000);
    Sunday, October 25, 2020 7:37 PM