mirror of
https://github.com/garraflavatra/rolens.git
synced 2025-01-18 13:07:58 +00:00
Add app name and version to mongo connections
This commit is contained in:
parent
84f1b85356
commit
0b9f23365b
@ -50,8 +50,8 @@ a {
|
|||||||
|
|
||||||
hr {
|
hr {
|
||||||
border: none;
|
border: none;
|
||||||
height: 1px;
|
border-top: 1px solid #ccc;
|
||||||
background-color: #ccc;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
|
@ -42,7 +42,11 @@ func (a *App) connectToHost(hostKey string) (*mongo.Client, context.Context, fun
|
|||||||
return nil, nil, nil, errors.New("invalid uri")
|
return nil, nil, nil, errors.New("invalid uri")
|
||||||
}
|
}
|
||||||
|
|
||||||
client, err := mongo.NewClient(mongoOptions.Client().ApplyURI(h.URI))
|
appName := "Rolens v" + a.Env.Version
|
||||||
|
opts := mongoOptions.Client()
|
||||||
|
opts.AppName = &appName
|
||||||
|
opts.ApplyURI(h.URI)
|
||||||
|
client, err := mongo.NewClient(opts)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.LogWarningf(a.ctx, "Could not connect to host %s: %s", hostKey, err.Error())
|
runtime.LogWarningf(a.ctx, "Could not connect to host %s: %s", hostKey, err.Error())
|
||||||
|
Loading…
Reference in New Issue
Block a user