Exemplo n.º 1
0
        private static async Task StopRedis()
        {
            await ExecUtil.Command("redis-cli", "save");

            await ExecUtil.Command("sudo", "service redis-server stop");
        }
Exemplo n.º 2
0
        private static async Task StartRedis()
        {
            await Task.Delay(TimeSpan.FromSeconds(2)); // Delay is needed otherwise Redis sometimes doesn't want to start and says "redis-server.service: Start request repeated too quickly."

            await ExecUtil.Command("sudo", "service redis-server start");
        }