File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ package main
3
3
import (
4
4
"context"
5
5
"fmt"
6
+ "net/url"
6
7
"os"
8
+ "strings"
7
9
"time"
8
10
_ "time/tzdata"
9
11
@@ -100,7 +102,13 @@ func main() {
100
102
log .Warnf ("signature header is blank. setting default %s" , config .DefaultSignatureHeader )
101
103
}
102
104
103
- conn := db .Database ("convoy" , nil )
105
+ u , err := url .Parse (cfg .Database .Dsn )
106
+ if err != nil {
107
+ return err
108
+ }
109
+
110
+ dbName := strings .TrimPrefix (u .Path , "/" )
111
+ conn := db .Database (dbName , nil )
104
112
105
113
app .groupRepo = datastore .NewGroupRepo (conn )
106
114
app .applicationRepo = datastore .NewApplicationRepo (conn )
Original file line number Diff line number Diff line change 1
1
{
2
- "sentry" : {
3
- "dsn" : " <insert-sentry-dsn>"
4
- },
5
- "database" : {
6
2
"environment" : " dev" ,
7
- "dsn" : " mongodb://root:rootpassword@mongodb:27017"
3
+ "database" : {
4
+ "dsn" : " mongodb://root:rootpassword@mongodb:27017/newConvoy?authSource=admin"
8
5
},
9
6
"queue" : {
10
7
"type" : " redis" ,
You can’t perform that action at this time.
0 commit comments