Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eceec1f

Browse filesBrowse files
committed
Runtime errors fixed, signal polishing
1 parent b4033b5 commit eceec1f
Copy full SHA for eceec1f

File tree

Expand file treeCollapse file tree

3 files changed

+9
-8
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+9
-8
lines changed

‎harness/build.go

Copy file name to clipboardExpand all lines: harness/build.go
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ import (
286286
"flag"
287287
"os"
288288
"os/signal"
289-
"syscall"
290289
"reflect"
291290
"github.com/revel/revel"{{range $k, $v := $.ImportPaths}}
292291
{{$v}} "{{$k}}"{{end}}
@@ -334,14 +333,13 @@ func main() {
334333
335334
signalChannel := make(chan os.Signal, 1)
336335
signal.Notify(signalChannel,
337-
os.Interrupt,
338-
syscall.SIGTERM)
336+
os.Interrupt, os.Kill)
339337
340338
go func() {
341339
sig := <- signalChannel
342-
revel.INFO("Server interrupt")
340+
revel.INFO.Println("Server interrupt")
343341
switch sig {
344-
case os.Interrupt, syscall.SIGTERM:
342+
case os.Interrupt, os.Kill:
345343
revel.StopServer()
346344
break
347345
}

‎harness/harness.go

Copy file name to clipboardExpand all lines: harness/harness.go
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ func NewHarness() *Harness {
120120
// Rebuild the Revel application and run it on the given port.
121121
func (h *Harness) Refresh() (err *revel.Error) {
122122
if h.app != nil {
123-
h.app.Kill()
123+
//h.app.Kill()
124+
h.app.cmd.Terminate()
124125
}
125126

126127
revel.TRACE.Println("Rebuild")
@@ -181,7 +182,8 @@ func (h *Harness) Run() {
181182
signal.Notify(ch, os.Interrupt, os.Kill)
182183
<-ch
183184
if h.app != nil {
184-
h.app.Kill()
185+
//h.app.Kill()
186+
h.app.cmd.Terminate()
185187
}
186188
os.Exit(1)
187189
}

‎server.go

Copy file name to clipboardExpand all lines: server.go
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var (
1818
MainTemplateLoader *TemplateLoader
1919
MainWatcher *Watcher
2020
Server *http.Server
21-
wg *sync.WaitGroup
21+
wg sync.WaitGroup
2222
stopSig = make(chan int)
2323
)
2424

@@ -164,6 +164,7 @@ func Run(port int) {
164164
}
165165

166166
} else {
167+
INFO.Println("Starting service")
167168
if err := http.Serve(listener, http.HandlerFunc(handle)); err != nil {
168169
ERROR.Println(err)
169170
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.