Skip to content

Commit

Permalink
Merge pull request #1336 from Permify/next-release
Browse files Browse the repository at this point in the history
fix: cache missing fields added
  • Loading branch information
tolgaOzen committed Jul 7, 2024
2 parents 0d5e570 + 7566e91 commit 22101f3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
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

0 comments on commit 22101f3

Please sign in to comment.