-
Notifications
You must be signed in to change notification settings - Fork 128
fix: retry auto-unlock StartApp on failure instead of silently staying locked #2564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,13 +7,17 @@ import ( | |
| "github.com/getAlby/hub/logger" | ||
| ) | ||
|
|
||
| func (svc *service) StopApp() { | ||
| if svc.appCancelFn != nil { | ||
| logger.Logger.Info("Stopping app...") | ||
| svc.appCancelFn() | ||
| svc.wg.Wait() | ||
| logger.Logger.Info("app stopped") | ||
| } | ||
| func (svc *service) StopApp() error { | ||
| // do not allow stopping while a start or stop is already in progress | ||
| return svc.WithStartLock(func() error { | ||
| if svc.appCancelFn != nil { | ||
| logger.Logger.Info("Stopping app...") | ||
| svc.appCancelFn() | ||
| svc.wg.Wait() | ||
| logger.Logger.Info("app stopped") | ||
| } | ||
| return nil | ||
|
Comment on lines
+15
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift Propagate LN client shutdown failures through
In Record and return the stop error. Keep an explicit failed or stopping state until shutdown succeeds. Also applies to: 23-31 🤖 Prompt for AI Agents |
||
| }) | ||
| } | ||
|
|
||
| func (svc *service) stopLNClient() { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.