Skip to content

Commit

Permalink
feat: initialize configuration and enhance IPC handling in task runne…
Browse files Browse the repository at this point in the history
…r tests

- Added configuration initialization in db.go to ensure proper setup of application settings.
- Refactored runner_test.go to streamline IPC message handling by introducing a setupPipe function and an initRunner function for better readability and maintainability.
- Improved synchronization in tests by using channels for signaling readiness and processing, enhancing the reliability of IPC message handling.
- Updated test cases to validate IPC message processing and error handling, ensuring robustness in the task runner's functionality.
  • Loading branch information
Marvin Zhang committed Jan 6, 2025
1 parent 8aa801e commit f5d9ccf
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 219 deletions.
5 changes: 5 additions & 0 deletions core/mongo/db.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package mongo

import (
"github.com/crawlab-team/crawlab/core/config"
"github.com/spf13/viper"
"go.mongodb.org/mongo-driver/mongo"
)

func init() {
config.InitConfig()
}

func GetMongoDb(dbName string) *mongo.Database {
// Use default database name if not provided
if dbName == "" {
Expand Down
Loading

0 comments on commit f5d9ccf

Please sign in to comment.