File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +9
-8
lines changed
Original file line number Diff line number Diff line change @@ -286,7 +286,6 @@ import (
286
286
"flag"
287
287
"os"
288
288
"os/signal"
289
- "syscall"
290
289
"reflect"
291
290
"github.com/revel/revel"{{range $k, $v := $.ImportPaths}}
292
291
{{$v}} "{{$k}}"{{end}}
@@ -334,14 +333,13 @@ func main() {
334
333
335
334
signalChannel := make(chan os.Signal, 1)
336
335
signal.Notify(signalChannel,
337
- os.Interrupt,
338
- syscall.SIGTERM)
336
+ os.Interrupt, os.Kill)
339
337
340
338
go func() {
341
339
sig := <- signalChannel
342
- revel.INFO("Server interrupt")
340
+ revel.INFO.Println ("Server interrupt")
343
341
switch sig {
344
- case os.Interrupt, syscall.SIGTERM :
342
+ case os.Interrupt, os.Kill :
345
343
revel.StopServer()
346
344
break
347
345
}
Original file line number Diff line number Diff line change @@ -120,7 +120,8 @@ func NewHarness() *Harness {
120
120
// Rebuild the Revel application and run it on the given port.
121
121
func (h * Harness ) Refresh () (err * revel.Error ) {
122
122
if h .app != nil {
123
- h .app .Kill ()
123
+ //h.app.Kill()
124
+ h .app .cmd .Terminate ()
124
125
}
125
126
126
127
revel .TRACE .Println ("Rebuild" )
@@ -181,7 +182,8 @@ func (h *Harness) Run() {
181
182
signal .Notify (ch , os .Interrupt , os .Kill )
182
183
<- ch
183
184
if h .app != nil {
184
- h .app .Kill ()
185
+ //h.app.Kill()
186
+ h .app .cmd .Terminate ()
185
187
}
186
188
os .Exit (1 )
187
189
}
Original file line number Diff line number Diff line change 18
18
MainTemplateLoader * TemplateLoader
19
19
MainWatcher * Watcher
20
20
Server * http.Server
21
- wg * sync.WaitGroup
21
+ wg sync.WaitGroup
22
22
stopSig = make (chan int )
23
23
)
24
24
@@ -164,6 +164,7 @@ func Run(port int) {
164
164
}
165
165
166
166
} else {
167
+ INFO .Println ("Starting service" )
167
168
if err := http .Serve (listener , http .HandlerFunc (handle )); err != nil {
168
169
ERROR .Println (err )
169
170
}
You can’t perform that action at this time.
0 commit comments