Refactor TED Scraper Initialization in Main Application

- Moved the initialization of the notification service to follow the MongoDB connection setup for better organization.
- Added comments to clarify the initialization sequence of services, including the TED scraper.
- Removed commented-out code related to stopping the scheduler to clean up the main function.
- Enhanced the overall readability and structure of the main application entry point.
This commit is contained in:
n.nakhostin
2025-10-04 15:25:40 +03:30
parent cc3d6163ed
commit 02157693af
+3 -5
View File
@@ -22,8 +22,6 @@ func main() {
"version": "1.0.0",
})
// Initialize notification service
// Initialize MongoDB connection
mongoManager := bootstrap.InitMongoDB(config.Database.MongoDB, appLogger)
defer func() {
@@ -36,7 +34,10 @@ func main() {
}
}()
// Initialize notification service
notificationService := bootstrap.InitNotificationService(config.Notification, appLogger)
// Initialize TED scraper
bootstrap.InitTEDScraper(*config, mongoManager, appLogger, notificationService)
// Set up signal handling for graceful shutdown
@@ -47,8 +48,5 @@ func main() {
<-signalChan
appLogger.Info("Received shutdown signal, stopping scheduler...", map[string]interface{}{})
// Stop the scheduler
// scheduler.Stop()
appLogger.Info("TED scraper application stopped", map[string]interface{}{})
}