Skip to content

Commit

Permalink
Merge pull request #24 from ne-sachirou/comment-out-debug
Browse files Browse the repository at this point in the history
起動や終了に失敗した時をdebugするcodeを殘しておく
  • Loading branch information
ne-sachirou authored Dec 25, 2024
2 parents 995e685 + 2610e29 commit 8a1b58f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func (s *ExampleServer) Serve() error {
}
}()
fmt.Println("example serve")
//return errors.New("faild to serve the server")
return nil
}

Expand All @@ -40,6 +41,8 @@ func (s *ExampleServer) Shutdown(ctx context.Context) error {
select {
case <-s.shutdowned:
fmt.Println("example shutdown")
//time.Sleep(time.Second * 2)
//return errors.New("faild to shutdown the server")
return nil
case <-ctx.Done():
if err := ctx.Err(); errors.Is(err, context.DeadlineExceeded) {
Expand All @@ -59,6 +62,7 @@ func (s *ExampleBlockingServer) Serve() error {
s.done = make(chan struct{})
s.shutdowned = make(chan struct{})
fmt.Println("example blocking serve")
//return errors.New("faild to serve the blocking server")
for {
select {
case <-s.done:
Expand All @@ -76,6 +80,8 @@ func (s *ExampleBlockingServer) Shutdown(ctx context.Context) error {
select {
case <-s.shutdowned:
fmt.Println("example blocking shutdown")
//time.Sleep(time.Second * 2)
//return errors.New("faild to shutdown the blocking server")
return nil
case <-ctx.Done():
if err := ctx.Err(); errors.Is(err, context.DeadlineExceeded) {
Expand Down

0 comments on commit 8a1b58f

Please sign in to comment.