Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
68796ee0
Commit
68796ee0
authored
1 year ago
by
ensiouel
Browse files
Options
Downloads
Patches
Plain Diff
fix(items): добавлена метрика в CachingMiddleware
parent
57e77656
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/content/client.go
+4
-1
4 additions, 1 deletion
pkg/content/client.go
with
4 additions
and
1 deletion
pkg/content/client.go
+
4
−
1
View file @
68796ee0
...
@@ -18,12 +18,14 @@ import (
...
@@ -18,12 +18,14 @@ import (
itemsTransportGrpc
"git.perx.ru/perxis/perxis-go/pkg/items/transport/grpc"
itemsTransportGrpc
"git.perx.ru/perxis/perxis-go/pkg/items/transport/grpc"
localesSvc
"git.perx.ru/perxis/perxis-go/pkg/locales/middleware"
localesSvc
"git.perx.ru/perxis/perxis-go/pkg/locales/middleware"
localsTransportGrpc
"git.perx.ru/perxis/perxis-go/pkg/locales/transport/grpc"
localsTransportGrpc
"git.perx.ru/perxis/perxis-go/pkg/locales/transport/grpc"
"git.perx.ru/perxis/perxis-go/pkg/metrics"
referencesSvc
"git.perx.ru/perxis/perxis-go/pkg/references/middleware"
referencesSvc
"git.perx.ru/perxis/perxis-go/pkg/references/middleware"
referencesTransportGrpc
"git.perx.ru/perxis/perxis-go/pkg/references/transport/grpc"
referencesTransportGrpc
"git.perx.ru/perxis/perxis-go/pkg/references/transport/grpc"
rolesSvc
"git.perx.ru/perxis/perxis-go/pkg/roles/middleware"
rolesSvc
"git.perx.ru/perxis/perxis-go/pkg/roles/middleware"
rolesTransportGrpc
"git.perx.ru/perxis/perxis-go/pkg/roles/transport/grpc"
rolesTransportGrpc
"git.perx.ru/perxis/perxis-go/pkg/roles/transport/grpc"
spacesSvc
"git.perx.ru/perxis/perxis-go/pkg/spaces/middleware"
spacesSvc
"git.perx.ru/perxis/perxis-go/pkg/spaces/middleware"
spacesTransportGrpc
"git.perx.ru/perxis/perxis-go/pkg/spaces/transport/grpc"
spacesTransportGrpc
"git.perx.ru/perxis/perxis-go/pkg/spaces/transport/grpc"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/zap"
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc"
)
)
...
@@ -75,13 +77,14 @@ func NewClient(conn *grpc.ClientConn, opts ...Option) *Content {
...
@@ -75,13 +77,14 @@ func NewClient(conn *grpc.ClientConn, opts ...Option) *Content {
func
WithCaching
(
client
*
Content
,
size
int
,
ttl
time
.
Duration
)
*
Content
{
func
WithCaching
(
client
*
Content
,
size
int
,
ttl
time
.
Duration
)
*
Content
{
c
:=
*
client
c
:=
*
client
cacheMetrics
:=
metrics
.
NewCacheMetrics
(
prometheus
.
DefaultRegisterer
)
c
.
Clients
=
clientsSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Clients
)
c
.
Clients
=
clientsSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Clients
)
c
.
Environments
=
environmentsSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Environments
)
c
.
Environments
=
environmentsSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Environments
)
c
.
Locales
=
localesSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Locales
)
c
.
Locales
=
localesSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Locales
)
c
.
Roles
=
rolesSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Roles
)
c
.
Roles
=
rolesSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Roles
)
c
.
Spaces
=
spacesSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Spaces
)
c
.
Spaces
=
spacesSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Spaces
)
c
.
Items
=
itemsSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
),
cache
.
NewCache
(
size
,
ttl
),
c
.
Environments
)(
client
.
Items
)
c
.
Items
=
itemsSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
),
cache
.
NewCache
(
size
,
ttl
),
cacheMetrics
,
c
.
Environments
)(
client
.
Items
)
c
.
Collections
=
collectionsSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
),
c
.
Environments
)(
client
.
Collections
)
c
.
Collections
=
collectionsSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
),
c
.
Environments
)(
client
.
Collections
)
c
.
Collaborators
=
collaboratorsSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Collaborators
)
c
.
Collaborators
=
collaboratorsSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Collaborators
)
c
.
Invitations
=
invitationsSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Invitations
)
c
.
Invitations
=
invitationsSvc
.
CachingMiddleware
(
cache
.
NewCache
(
size
,
ttl
))(
client
.
Invitations
)
...
...
This diff is collapsed.
Click to expand it.
Semyon Krestyaninov
@krestyaninov
mentioned in commit
75ab1f26
·
1 year ago
mentioned in commit
75ab1f26
mentioned in commit 75ab1f26e792c20a1dafaea5c53e12c2b1623627
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment