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
b3367b90
Commit
b3367b90
authored
Feb 10, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20892 from lavalamp/fix-us-log
Auto commit by PR queue bot
parents
66e87222
4e85d42f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
cacher.go
pkg/storage/cacher.go
+7
-8
No files found.
pkg/storage/cacher.go
View file @
b3367b90
...
@@ -171,13 +171,14 @@ func NewCacherFromConfig(config CacherConfig) *Cacher {
...
@@ -171,13 +171,14 @@ func NewCacherFromConfig(config CacherConfig) *Cacher {
stopCh
:=
cacher
.
stopCh
stopCh
:=
cacher
.
stopCh
cacher
.
stopWg
.
Add
(
1
)
cacher
.
stopWg
.
Add
(
1
)
go
func
()
{
go
func
()
{
defer
cacher
.
stopWg
.
Done
()
wait
.
Until
(
wait
.
Until
(
func
()
{
func
()
{
if
!
cacher
.
isStopped
()
{
if
!
cacher
.
isStopped
()
{
cacher
.
startCaching
(
stopCh
)
cacher
.
startCaching
(
stopCh
)
}
}
},
0
,
stopCh
)
},
time
.
Second
,
stopCh
,
cacher
.
stopWg
.
Done
(
)
)
}()
}()
return
cacher
return
cacher
}
}
...
@@ -197,12 +198,10 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) {
...
@@ -197,12 +198,10 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) {
c
.
terminateAllWatchers
()
c
.
terminateAllWatchers
()
// Note that since onReplace may be not called due to errors, we explicitly
// Note that since onReplace may be not called due to errors, we explicitly
// need to retry it on errors under lock.
// need to retry it on errors under lock.
for
{
// Also note that startCaching is called in a loop, so there's no need
if
err
:=
c
.
reflector
.
ListAndWatch
(
stopChannel
);
err
!=
nil
{
// to have another loop here.
glog
.
Errorf
(
"unexpected ListAndWatch error: %v"
,
err
)
if
err
:=
c
.
reflector
.
ListAndWatch
(
stopChannel
);
err
!=
nil
{
}
else
{
glog
.
Errorf
(
"unexpected ListAndWatch error: %v"
,
err
)
break
}
}
}
}
}
...
...
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