1
0
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:
Romein van Buren 2023-07-01 10:35:41 +02:00
parent 84f1b85356
commit 0b9f23365b
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
2 changed files with 7 additions and 3 deletions

View File

@ -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 {

View File

@ -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())