forked from TrueCloudLab/neoneo-go
cli: use new configuration for the RPC server
Also fix addresses if needed and store this new configuration.
This commit is contained in:
parent
94099de3c3
commit
6593b94594
1 changed files with 4 additions and 2 deletions
|
@ -542,15 +542,17 @@ Main:
|
||||||
log.Warn("ApplicationConfiguration changed in incompatible way, signal ignored")
|
log.Warn("ApplicationConfiguration changed in incompatible way, signal ignored")
|
||||||
break // Continue working.
|
break // Continue working.
|
||||||
}
|
}
|
||||||
|
configureAddresses(&cfgnew.ApplicationConfiguration)
|
||||||
switch sig {
|
switch sig {
|
||||||
case syscall.SIGHUP:
|
case syscall.SIGHUP:
|
||||||
rpcServer.Shutdown()
|
rpcServer.Shutdown()
|
||||||
rpcServer = rpcsrv.New(chain, cfg.ApplicationConfiguration.RPC, serv, oracleSrv, log, errChan)
|
rpcServer = rpcsrv.New(chain, cfgnew.ApplicationConfiguration.RPC, serv, oracleSrv, log, errChan)
|
||||||
serv.AddService(&rpcServer) // Replaces old one by service name.
|
serv.AddService(&rpcServer) // Replaces old one by service name.
|
||||||
if !cfg.ApplicationConfiguration.RPC.StartWhenSynchronized || serv.IsInSync() {
|
if !cfgnew.ApplicationConfiguration.RPC.StartWhenSynchronized || serv.IsInSync() {
|
||||||
rpcServer.Start()
|
rpcServer.Start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cfg = cfgnew
|
||||||
case <-grace.Done():
|
case <-grace.Done():
|
||||||
signal.Stop(sighupCh)
|
signal.Stop(sighupCh)
|
||||||
serv.Shutdown()
|
serv.Shutdown()
|
||||||
|
|
Loading…
Reference in a new issue