
Task Scheduling
Cron jobs, intervals, timeouts, dynamic scheduling, distributed scheduling
1What is the official npm package used by NestJS for managing scheduled tasks?
What is the official npm package used by NestJS for managing scheduled tasks?
Câu trả lời
@nestjs/schedule is the official package integrated with NestJS for managing cron jobs, intervals, and timeouts. It relies on the node-cron package under the hood. Installing this package enables the use of @Cron, @Interval, and @Timeout decorators in providers.
2How to enable the scheduling module in a NestJS application?
How to enable the scheduling module in a NestJS application?
Câu trả lời
Importing ScheduleModule.forRoot() in the application's root module enables the scheduling system. This method initializes the scheduler and allows the use of scheduled task decorators throughout the application. Without this import, scheduled tasks will not execute.
3Which cron syntax allows executing a task every day at midnight?
Which cron syntax allows executing a task every day at midnight?
Câu trả lời
The cron syntax '0 0 * * *' means: minute 0, hour 0, every day of the month, every month, every day of the week. This is the standard expression for scheduling a daily task at midnight. The cron format follows the order: minute hour day month day-of-week.
How to create a cron job that runs every 5 minutes in NestJS?
What is the advantage of using CronExpression.EVERY_HOUR instead of '0 * * * *'?
+12 câu hỏi phỏng vấn
Các chủ đề phỏng vấn Node.js / NestJS khác
Node.js Fundamentals
Node.js Core APIs
Asynchronous Programming
Express.js Basics
NestJS Fundamentals
REST API Design
Validation & DTO
API Documentation & Contracts
Error Handling
Unit Testing
NestJS Modules & DI
Configuration & Environment Management
JWT Authentication
Authorization & RBAC
Database with TypeORM
Prisma ORM
Middleware & Interceptors
File Upload
WebSockets
GraphQL with NestJS
End-to-End Testing
Caching with Redis
Queues with Bull
DevOps, Logging & CI/CD
Docker & Containerization
Microservices
Security Best Practices
Performance & Cloud Deployment
Nắm vững Node.js / NestJS cho lần phỏng vấn tiếp theo
Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.
Bắt đầu miễn phí