Merge pull request 'Fix Tor Reset to Update Settings and Avoid Contention on datadir' (#63) from custom_tor_config into trunk
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Reviewed-on: #63
This commit is contained in:
commit
84d451fb46
10
lib.go
10
lib.go
|
@ -800,7 +800,15 @@ func c_ResetTor() {
|
||||||
|
|
||||||
func ResetTor() {
|
func ResetTor() {
|
||||||
log.Infof("Replacing ACN with new Tor...")
|
log.Infof("Replacing ACN with new Tor...")
|
||||||
globalACN.ReplaceACN(buildACN(*utils.ReadGlobalSettings(), globalTorPath, globalAppDir))
|
settings := utils.ReadGlobalSettings()
|
||||||
|
|
||||||
|
globalACN.Close() // we need to close first if dateDir is the same, otherwise buildACN can't launch tor.
|
||||||
|
globalACN.ReplaceACN(buildACN(*settings, globalTorPath, globalAppDir))
|
||||||
|
|
||||||
|
// We need to update settings on reset as buildACN can alter settings, otherwise the next reset will be broken...
|
||||||
|
settings = utils.ReadGlobalSettings()
|
||||||
|
settingsJson, _ := json.Marshal(settings)
|
||||||
|
application.GetPrimaryBus().Publish(event.NewEvent(utils.UpdateGlobalSettings, map[event.Field]string{event.Data: string(settingsJson)}))
|
||||||
log.Infof("Restarted")
|
log.Infof("Restarted")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue