Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
d0892abc
Commit
d0892abc
authored
Feb 08, 2018
by
Sandeep Rajan
Committed by
John Belamaric
Feb 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add sync for proper termination (#1507)
parent
6fd954f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
plugin/reload/setup.go
plugin/reload/setup.go
+6
-3
No files found.
plugin/reload/setup.go
View file @
d0892abc
...
@@ -24,6 +24,7 @@ func init() {
...
@@ -24,6 +24,7 @@ func init() {
// WARNING: this data may be unsync after an invalid attempt of reload Corefile.
// WARNING: this data may be unsync after an invalid attempt of reload Corefile.
var
r
=
reload
{
interval
:
defaultInterval
,
usage
:
unused
,
quit
:
make
(
chan
bool
)}
var
r
=
reload
{
interval
:
defaultInterval
,
usage
:
unused
,
quit
:
make
(
chan
bool
)}
var
once
sync
.
Once
var
once
sync
.
Once
var
shutOnce
sync
.
Once
func
setup
(
c
*
caddy
.
Controller
)
error
{
func
setup
(
c
*
caddy
.
Controller
)
error
{
c
.
Next
()
// 'reload'
c
.
Next
()
// 'reload'
...
@@ -73,10 +74,12 @@ func setup(c *caddy.Controller) error {
...
@@ -73,10 +74,12 @@ func setup(c *caddy.Controller) error {
})
})
// re-register on finalShutDown as the instance most-likely will be changed
// re-register on finalShutDown as the instance most-likely will be changed
shutOnce
.
Do
(
func
()
{
c
.
OnFinalShutdown
(
func
()
error
{
c
.
OnFinalShutdown
(
func
()
error
{
r
.
quit
<-
true
r
.
quit
<-
true
return
nil
return
nil
})
})
})
return
nil
return
nil
}
}
...
...
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