mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-27 17:50:53 +01:00
Revert "Revert "V0.4.0 imporve error response""
This reverts commit 9744f45e86.
This commit is contained in:
@@ -3,6 +3,7 @@ package database
|
||||
import (
|
||||
"github.com/globalsign/mgo"
|
||||
"github.com/spf13/viper"
|
||||
"time"
|
||||
)
|
||||
|
||||
var Session *mgo.Session
|
||||
@@ -44,7 +45,7 @@ func InitMongo() error {
|
||||
} else {
|
||||
uri = "mongodb://" + mongoUsername + ":" + mongoPassword + "@" + mongoHost + ":" + mongoPort + "/" + mongoDb + "?authSource=" + mongoAuth
|
||||
}
|
||||
sess, err := mgo.Dial(uri)
|
||||
sess, err := mgo.DialWithTimeout(uri, time.Second*5)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user