-
Notifications
You must be signed in to change notification settings - Fork 31
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
Feat: multi entry #223
Feat: multi entry #223
Conversation
how about we do it as in lndhub and move the main* to a cmd folder?
|
main.go
Outdated
func main() { | ||
|
||
// TODO: move to service.go | ||
func NewService(wg *sync.WaitGroup) *Service { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- why do we need this WaitGroup passed in here. This feels a bit strange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the service is run on a separate process. The go process exits before that process is gracefully shut down (e.g. disconnect from the relay). The app wasn't actually exiting gracefully though. I have fixed these now, maybe we can review it together?
I don't think we can fix this right now without a big app restructure: we need to move everything out of the main package. Also, I could be wrong but I'm not sure the default Wails build command supports this: https://wails.io/docs/reference/cli#build - we might need to do a manual build. It seems go build tags are more suited to this usecase (a slight variant of executing the same application). If we decide to make this change I think it can be done in the future. The build commands will change but everything else should stay the same. Or do you see a problem here that we need to address now? |
#222 should be merged first.
This PR removes the app type conditional in the go app by adding two separate entrypoints powered by build tags.
Now the wails app also sets the react app type at build time, so no env variable / .env file is needed.
COOKIE_SECRET is now only checked in the HTTP entrypoint.
The default (HTTP) mode arguments do not change because it uses a NOT WAILS (!wails) build tag.