Skip to content

Commit

Permalink
refactor: app statr interface
Browse files Browse the repository at this point in the history
  • Loading branch information
yccodr committed May 8, 2024
1 parent db71e05 commit 01f38b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type NssfApp interface {
SetLogLevel(level string)
SetReportCaller(reportCaller bool)

Start() error
Start()
Terminate()

Context() *nssf_context.NSSFContext
Expand Down
6 changes: 2 additions & 4 deletions pkg/service/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (a *NssfApp) deregisterFromNrf() {
}
}

func (a *NssfApp) Start() error {
func (a *NssfApp) Start() {
ctx, cancel := context.WithCancel(context.Background())
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM)
Expand All @@ -137,7 +137,7 @@ func (a *NssfApp) Start() error {

err := a.registerToNrf()
if err != nil {
return fmt.Errorf("register to NRF failed: %+v", err)
logger.MainLog.Errorf("register to NRF failed: %+v", err)
} else {
logger.MainLog.Infoln("register to NRF successfully")
}
Expand All @@ -152,8 +152,6 @@ func (a *NssfApp) Start() error {

a.sbiServer.Run(&a.wg)
go a.listenShutdown(ctx)

return nil
}

func (a *NssfApp) listenShutdown(ctx context.Context) {
Expand Down

0 comments on commit 01f38b7

Please sign in to comment.