Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
497f891c
Commit
497f891c
authored
Aug 10, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log warning when terminating all watchers
parent
ccb9b2af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
cacher.go
pkg/storage/cacher.go
+5
-0
No files found.
pkg/storage/cacher.go
View file @
497f891c
...
@@ -138,6 +138,9 @@ type Cacher struct {
...
@@ -138,6 +138,9 @@ type Cacher struct {
// Underlying storage.Interface.
// Underlying storage.Interface.
storage
Interface
storage
Interface
// Expected type of objects in the underlying cache.
objectType
reflect
.
Type
// "sliding window" of recent changes of objects and the current state.
// "sliding window" of recent changes of objects and the current state.
watchCache
*
watchCache
watchCache
*
watchCache
reflector
*
cache
.
Reflector
reflector
*
cache
.
Reflector
...
@@ -181,6 +184,7 @@ func NewCacherFromConfig(config CacherConfig) *Cacher {
...
@@ -181,6 +184,7 @@ func NewCacherFromConfig(config CacherConfig) *Cacher {
cacher
:=
&
Cacher
{
cacher
:=
&
Cacher
{
ready
:
newReady
(),
ready
:
newReady
(),
storage
:
config
.
Storage
,
storage
:
config
.
Storage
,
objectType
:
reflect
.
TypeOf
(
config
.
Type
),
watchCache
:
watchCache
,
watchCache
:
watchCache
,
reflector
:
cache
.
NewReflector
(
listerWatcher
,
config
.
Type
,
watchCache
,
0
),
reflector
:
cache
.
NewReflector
(
listerWatcher
,
config
.
Type
,
watchCache
,
0
),
versioner
:
config
.
Versioner
,
versioner
:
config
.
Versioner
,
...
@@ -440,6 +444,7 @@ func (c *Cacher) processEvent(event watchCacheEvent) {
...
@@ -440,6 +444,7 @@ func (c *Cacher) processEvent(event watchCacheEvent) {
}
}
func
(
c
*
Cacher
)
terminateAllWatchers
()
{
func
(
c
*
Cacher
)
terminateAllWatchers
()
{
glog
.
Warningf
(
"Terminating all watchers from cacher %v"
,
c
.
objectType
)
c
.
Lock
()
c
.
Lock
()
defer
c
.
Unlock
()
defer
c
.
Unlock
()
c
.
watchers
.
terminateAll
()
c
.
watchers
.
terminateAll
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment