mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
multi: add accounts service to status manager
Add the accounts service to status manager. This will allow us to query the status of the accounts service and see if it is running or not. For incoming gRPC requests to the accounts service, we also use the status manager to check if the accounts service is running or not to determine if we should let the request through or not.
This commit is contained in:
parent
6f9f3244fb
commit
ec2a7a39b4
4 changed files with 31 additions and 27 deletions
13
rpc_proxy.go
13
rpc_proxy.go
|
|
@ -623,6 +623,9 @@ func (p *rpcProxy) checkSubSystemStarted(requestURI string) error {
|
|||
switch {
|
||||
case handled:
|
||||
|
||||
case isAccountsReq(requestURI):
|
||||
system = subservers.ACCOUNTS
|
||||
|
||||
case p.permsMgr.IsSubServerURI(subservers.LIT, requestURI):
|
||||
system = subservers.LIT
|
||||
|
||||
|
|
@ -694,3 +697,13 @@ func isProxyReq(uri string) bool {
|
|||
uri, fmt.Sprintf("/%s", litrpc.Proxy_ServiceDesc.ServiceName),
|
||||
)
|
||||
}
|
||||
|
||||
// isAccountsReq returns true if the given request is intended for the
|
||||
// litrpc.Accounts service.
|
||||
func isAccountsReq(uri string) bool {
|
||||
return strings.HasPrefix(
|
||||
uri, fmt.Sprintf(
|
||||
"/%s", litrpc.Accounts_ServiceDesc.ServiceName,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue