MM-21357: Use typed constants ClusterEvent (#17920)

* MM-21357: Use typed constants ClusterEvent

Use typed constants for:
- model.ClusterEvent

https://mattermost.atlassian.net/browse/MM-21357

```release-note
Use typed constant for model.ClusterEvent
```

* trigger CI
```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2021-07-15 11:02:17 +05:30
коммит произвёл Claudio Costa
родитель 9ae45d55d9
Коммит 623f8dc9af
14 изменённых файлов: 61 добавлений и 49 удалений

6
services/cache/lru.go поставляемый
Просмотреть файл

@@ -24,7 +24,7 @@ type LRU struct {
items map[string]*list.Element
defaultExpiry time.Duration
name string
invalidateClusterEvent string
invalidateClusterEvent model.ClusterEvent
}
// LRUOptions contains options for initializing LRU cache
@@ -32,7 +32,7 @@ type LRUOptions struct {
Name string
Size int
DefaultExpiry time.Duration
InvalidateClusterEvent string
InvalidateClusterEvent model.ClusterEvent
// StripedBuckets is used only by LRUStriped and shouldn't be greater than the number
// of CPUs available on the machine running this cache.
StripedBuckets int
@@ -128,7 +128,7 @@ func (l *LRU) Len() (int, error) {
}
// GetInvalidateClusterEvent returns the cluster event configured when this cache was created.
func (l *LRU) GetInvalidateClusterEvent() string {
func (l *LRU) GetInvalidateClusterEvent() model.ClusterEvent {
return l.invalidateClusterEvent
}