void RestartCoreWorker(Action next) { var finalConfig = configer.GetFinalConfig(); if (finalConfig == null) { StopCoreThen(next); return; } v2rayCore.title = coreStates.GetTitle(); v2rayCore.RestartCoreThen( finalConfig.ToString(), () => next?.Invoke(), Misc.Utils.GetEnvVarsFromConfig(finalConfig)); }
void RestartCoreWorker(Action next) { try { var finalConfig = configer.GetFinalConfig(); if (finalConfig == null) { StopCore(); return; } v2rayCore.title = coreStates.GetTitle(); v2rayCore.RestartCore(finalConfig.ToString(), Misc.Utils.GetEnvVarsFromConfig(finalConfig)); bookKeeper?.Run(); } finally { next?.Invoke(); } }