Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
fc75527e
Commit
fc75527e
authored
Oct 23, 2017
by
elcore
Committed by
GitHub
Oct 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
onevent/startupshutdown: run command once per server block (#1934)
parent
e5d04f9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
onevent/on.go
onevent/on.go
+6
-3
startupshutdown/startupshutdown.go
startupshutdown/startupshutdown.go
+6
-3
No files found.
onevent/on.go
View file @
fc75527e
...
@@ -20,9 +20,12 @@ func setup(c *caddy.Controller) error {
...
@@ -20,9 +20,12 @@ func setup(c *caddy.Controller) error {
}
}
// Register Event Hooks.
// Register Event Hooks.
for
_
,
cfg
:=
range
config
{
c
.
OncePerServerBlock
(
func
()
error
{
caddy
.
RegisterEventHook
(
"on-"
+
cfg
.
ID
,
cfg
.
Hook
)
for
_
,
cfg
:=
range
config
{
}
caddy
.
RegisterEventHook
(
"on-"
+
cfg
.
ID
,
cfg
.
Hook
)
}
return
nil
})
return
nil
return
nil
}
}
...
...
startupshutdown/startupshutdown.go
View file @
fc75527e
...
@@ -36,9 +36,12 @@ func Startup(c *caddy.Controller) error {
...
@@ -36,9 +36,12 @@ func Startup(c *caddy.Controller) error {
}
}
// Register Event Hooks.
// Register Event Hooks.
for
_
,
cfg
:=
range
config
{
c
.
OncePerServerBlock
(
func
()
error
{
caddy
.
RegisterEventHook
(
"on-"
+
cfg
.
ID
,
cfg
.
Hook
)
for
_
,
cfg
:=
range
config
{
}
caddy
.
RegisterEventHook
(
"on-"
+
cfg
.
ID
,
cfg
.
Hook
)
}
return
nil
})
fmt
.
Println
(
"NOTICE: Startup directive will be removed in a later version. Please migrate to 'on startup'"
)
fmt
.
Println
(
"NOTICE: Startup directive will be removed in a later version. Please migrate to 'on startup'"
)
...
...
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