public void RerunCommands() { try { List <CommandDto> Commands = new List <CommandDto>(); Commands = JsonConvert.DeserializeObject <List <CommandDto> >(LocalFileHelper .GetLocalJson(LocalFileHelper._commandsFile)); if (Commands?.Count > 0) { PushAMsgIn(Guid.Empty, Guid.Empty, $"服务日志: Rerun {Commands.Count} commands.", LiveStateType.Started); foreach (var command in Commands) { ExecuteCommand(command); } } } catch (Exception ex) { LogHelper.SetLogError($"推流日志: {ex.ToString()}"); } }
public void SerializationCommangs() { List <CommandDto> commandDtos = ChannelPusherService.ChannelPushers.Select(p => p.CommandDto).ToList(); LocalFileHelper.SerializationCommands(JsonHelper.ToJSON(commandDtos)); }