Refactor Worker Initialization to Remove Ollama SDK Dependency
- Removed the Ollama SDK from the worker initialization process, simplifying the worker's dependencies and enhancing maintainability. - Updated the InitWorker function and NewNoticeWorker constructor to reflect the removal of the Ollama SDK, ensuring a cleaner and more focused implementation. - Commented out the Ollama model listing logic for potential future use, maintaining clarity in the main function while reducing unnecessary complexity.
This commit is contained in:
+9
-9
@@ -38,17 +38,17 @@ func main() {
|
||||
notificationService := bootstrap.InitNotificationService(config.Notification, appLogger)
|
||||
|
||||
// Initialize ollama service
|
||||
ollamaSDK := bootstrap.InitOllamaService(config.Ollama, appLogger)
|
||||
aiModels, err := ollamaSDK.ListModels(context.Background())
|
||||
if err != nil {
|
||||
appLogger.Error("Failed to list ollama models", map[string]interface{}{
|
||||
"error": err.Error(),
|
||||
})
|
||||
}
|
||||
appLogger.Info("Ollama models", map[string]interface{}{"models": aiModels})
|
||||
// ollamaSDK := bootstrap.InitOllamaService(config.Ollama, appLogger)
|
||||
// aiModels, err := ollamaSDK.ListModels(context.Background())
|
||||
// if err != nil {
|
||||
// appLogger.Error("Failed to list ollama models", map[string]interface{}{
|
||||
// "error": err.Error(),
|
||||
// })
|
||||
// }
|
||||
// appLogger.Info("Ollama models", map[string]interface{}{"models": aiModels})
|
||||
|
||||
// Initialize Worker
|
||||
bootstrap.InitWorker(*config, mongoManager, appLogger, notificationService, ollamaSDK)
|
||||
bootstrap.InitWorker(*config, mongoManager, appLogger, notificationService)
|
||||
|
||||
// Set up signal handling for graceful shutdown
|
||||
signalChan := make(chan os.Signal, 1)
|
||||
|
||||
Reference in New Issue
Block a user