public void Shutdown() { _actorSystem.Terminate().Wait(TimeSpan.FromSeconds(5)); try { _file.Delete(); } catch { //try again... Thread.Sleep(TimeSpan.FromSeconds(10)); _file.Delete(); } }