Skip to content

Commit

Permalink
fixed auto update status
Browse files Browse the repository at this point in the history
  • Loading branch information
insane1304 committed Apr 10, 2021
1 parent 08af5e7 commit 87aeefa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ app.use(passport.initialize());
app.use(passport.session());

app.use(flash());
mongoose.connect("mongodb://localhost:27017/todo", {
useNewUrlParser: true,
useUnifiedTopology: true
});
// mongoose.connect(process.env.DATABASE_URL,{useNewUrlParser:true, useUnifiedTopology: true });
// mongoose.connect("mongodb://localhost:27017/todo", {
// useNewUrlParser: true,
// useUnifiedTopology: true
// });
mongoose.connect(process.env.DATABASE_URL,{useNewUrlParser:true, useUnifiedTopology: true });
mongoose.set("useCreateIndex", true);
const connection = mongoose.connection;
connection.once('open', () => {
Expand Down Expand Up @@ -133,7 +133,7 @@ async function findVisitor() {
// today = yyyy + '-' + mm + '-' + dd;
// console.log(today);

cron.schedule('0 0 0 * * *', () => {
cron.schedule('0 8 1 * * *', () => {
updateStatus();
async function updateStatus() {
await User.find({
Expand Down Expand Up @@ -227,7 +227,7 @@ cron.schedule('0 0 0 * * *', () => {
};
}, {
scheduled: true,
timezone: "Asia/Kolkata"
timezone: process.env.TZ
});

require('./login')(app);
Expand Down

0 comments on commit 87aeefa

Please sign in to comment.