refactor: enhance health check function and add comprehensive test coverage

- Updated GetHealthFn to return an error for better error handling and clarity.
- Introduced a new test file for schedule management, covering various endpoints including creation, retrieval, updating, and deletion of schedules.
- Added tests for task management, including task creation, retrieval, updating, and cancellation.
- Implemented utility tests for filtering and response generation to ensure consistent API behavior.
- Improved logging in the task scheduler service for better traceability.
This commit is contained in:
Marvin Zhang
2025-03-13 18:10:24 +08:00
parent 43691d0d8a
commit ce0143ca06
6 changed files with 906 additions and 3 deletions

View File

@@ -245,6 +245,7 @@ func newTaskSchedulerService() *Service {
interval: 5 * time.Second,
svr: server.GetGrpcServer(),
handlerSvc: handler.GetTaskHandlerService(),
Logger: utils.NewLogger("TaskScheduler"),
}
}