Skip to content

Commit

Permalink
fix: remove properties
Browse files Browse the repository at this point in the history
  • Loading branch information
GalvinGao committed May 14, 2024
1 parent b6ac0a5 commit 22a49f1
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions internal/model/cache/caches.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cache

import (
"context"
"sync"
"time"

Expand All @@ -11,7 +10,6 @@ import (
"exusiai.dev/backend-next/internal/model"
modelv2 "exusiai.dev/backend-next/internal/model/v2"
"exusiai.dev/backend-next/internal/pkg/cache"
"exusiai.dev/backend-next/internal/repo"
)

type Flusher func() error
Expand Down Expand Up @@ -74,18 +72,15 @@ var (

LastModifiedTime *cache.Set[time.Time]

Properties map[string]string

once sync.Once

SetMap map[string]Flusher
SingularFlusherMap map[string]Flusher
)

func Initialize(propertyRepo *repo.Property) {
func Initialize() {
once.Do(func() {
initializeCaches()
populateProperties(propertyRepo)
})
}

Expand Down Expand Up @@ -242,15 +237,3 @@ func initializeCaches() {

SetMap["lastModifiedTime#key"] = LastModifiedTime.Flush
}

func populateProperties(repo *repo.Property) {
Properties = make(map[string]string)
properties, err := repo.GetProperties(context.Background())
if err != nil {
panic(err)
}

for _, property := range properties {
Properties[property.Key] = property.Value
}
}

0 comments on commit 22a49f1

Please sign in to comment.