mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
added disabled check for logging db type config option
This commit is contained in:
@@ -18,4 +18,4 @@ PDF, Epub, Manpage http://readthedocs.org/projects/cgrates/downloads/
|
||||
|
||||
API reference http://gopkgdoc.appspot.com/pkg/github.com/cgrates/cgrates
|
||||
|
||||
Current build status: [](http://goci.me/project/github.com/cgrates/cgrates)
|
||||
Continous integration: [](http://goci.me/project/github.com/cgrates/cgrates)
|
||||
|
||||
@@ -245,12 +245,15 @@ func main() {
|
||||
defer getter.Close()
|
||||
timespans.SetStorageGetter(getter)
|
||||
|
||||
db, err := sql.Open(logging_db_type, fmt.Sprintf("host=%s port=%s dbname=%s user=%s password=%s sslmode=disable", logging_db_host, logging_db_port, logging_db_db, logging_db_user, logging_db_password))
|
||||
if err != nil {
|
||||
timespans.Logger.Err(fmt.Sprintf("Could not connect to logger database: %v", err))
|
||||
}
|
||||
if db != nil {
|
||||
defer db.Close()
|
||||
var db *sql.DB
|
||||
if logging_db_type != DISABLED {
|
||||
db, err = sql.Open(logging_db_type, fmt.Sprintf("host=%s port=%s dbname=%s user=%s password=%s sslmode=disable", logging_db_host, logging_db_port, logging_db_db, logging_db_user, logging_db_password))
|
||||
if err != nil {
|
||||
timespans.Logger.Err(fmt.Sprintf("Could not connect to logger database: %v", err))
|
||||
}
|
||||
if db != nil {
|
||||
defer db.Close()
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user