Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cache missing fields added #1336

Merged
merged 1 commit into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions internal/engines/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import (
base "github.com/Permify/permify/pkg/pb/base/v1"
)

var tracer = otel.Tracer("check-cache")
var meter = otel.Meter("check-cache")
var (
tracer = otel.Tracer("check-cache")
meter = otel.Meter("check-cache")
)

// CheckEngineWithCache is a struct that holds an instance of a cache.Cache for managing engine cache.
type CheckEngineWithCache struct {
Expand Down
10 changes: 5 additions & 5 deletions internal/engines/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var _ = Describe("cache", func() {
Expect(err).ShouldNot(HaveOccurred())

// Initialize a new EngineKeys struct with a new cache.Cache instance
engineKeys := CheckEngineWithCache{nil, nil, cache, nil}
engineKeys := CheckEngineWithCache{nil, nil, cache, nil, nil}

// Create a new PermissionCheckRequest and PermissionCheckResponse
checkReq := &base.PermissionCheckRequest{
Expand Down Expand Up @@ -92,7 +92,7 @@ var _ = Describe("cache", func() {
Expect(err).ShouldNot(HaveOccurred())

// Initialize a new EngineKeys struct with a new cache.Cache instance
engineKeys := CheckEngineWithCache{nil, nil, cache, nil}
engineKeys := CheckEngineWithCache{nil, nil, cache, nil, nil}

// Create a new PermissionCheckRequest and PermissionCheckResponse
checkReq := &base.PermissionCheckRequest{
Expand Down Expand Up @@ -142,7 +142,7 @@ var _ = Describe("cache", func() {
Expect(err).ShouldNot(HaveOccurred())

// Initialize a new EngineKeys struct with a new cache.Cache instance
engineKeys := CheckEngineWithCache{nil, nil, cache, nil}
engineKeys := CheckEngineWithCache{nil, nil, cache, nil, nil}

// Create a new PermissionCheckRequest and PermissionCheckResponse
checkReq := &base.PermissionCheckRequest{
Expand Down Expand Up @@ -286,7 +286,7 @@ var _ = Describe("cache", func() {
Expect(err).ShouldNot(HaveOccurred())

// Initialize a new EngineKeys struct with a new cache.Cache instance
engineKeys := CheckEngineWithCache{nil, nil, cache, nil}
engineKeys := CheckEngineWithCache{nil, nil, cache, nil, nil}

// Create a new PermissionCheckRequest
checkReq := &base.PermissionCheckRequest{
Expand Down Expand Up @@ -321,7 +321,7 @@ var _ = Describe("cache", func() {
Expect(err).ShouldNot(HaveOccurred())

// Initialize a new EngineKeys struct with a new cache.Cache instance
engineKeys := CheckEngineWithCache{nil, nil, cache, nil}
engineKeys := CheckEngineWithCache{nil, nil, cache, nil, nil}

// Create some new PermissionCheckRequests and PermissionCheckResponses
checkReq1 := &base.PermissionCheckRequest{
Expand Down
6 changes: 4 additions & 2 deletions internal/invoke/invoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import (
"github.com/Permify/permify/pkg/tuple"
)

var tracer = otel.Tracer("invoke")
var meter = otel.Meter("invoke")
var (
tracer = otel.Tracer("invoke")
meter = otel.Meter("invoke")
)

// Invoker is an interface that groups multiple permission-related interfaces.
// It is used to define a common contract for invoking various permission operations.
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func serve() func(cmd *cobra.Command, args []string) error {
panic(err)
}

file, err := os.OpenFile(cfg.Log.File+"/app.json", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0o666)
file, err := os.OpenFile(cfg.Log.File+"/app.json", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0o600)
if err != nil {
panic(err)
}
Expand Down
Loading