-
Notifications
You must be signed in to change notification settings - Fork 0
Task 2 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| @@ -0,0 +1,15 @@ | |||
| import mongoose from 'mongoose'; | |||
| const url = "mongodb://localhost:27017/cron-testing"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
place this in .env file
|
|
||
| }catch(e){ | ||
| console.log(e,"ERRRRRR"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use proper indentation.
| const userSchema: Schema<User> = new Schema<User>({ | ||
| name: { type: String, required: true }, | ||
| email: { type: String, required: true }, | ||
| user_id: { type: String, required: true }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename this as username
| password: { type: String, required: true }, | ||
| phone_no: { type: String, required: true }, | ||
| created_At: { type: Date, default: Date.now }, | ||
| updated_At: { type: Date, default: Date.now }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make use of timestamps:true
| import fs from 'fs'; | ||
| import cron from 'node-cron'; | ||
|
|
||
| const app=express(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make use of classes
|
|
||
|
|
||
| const task=cron.schedule('*/3 * * * * *', () => { | ||
| const filePath = '/home/user/Videos/error_log/error.log'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make use of global path, check if cwd works
No description provided.