mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-26 05:02:36 +01:00
Add some retry when batch writing files
This commit is contained in:
parent
166a56f7f7
commit
aca715115f
@ -1383,8 +1383,25 @@ namespace Nikse.SubtitleEdit.Logic.CommandLineConvert
|
|||||||
sub.Header = AdvancedSubStationAlpha.AddTagToHeader("PlayResY", "PlayResY: " + resolution.Value.Y.ToString(CultureInfo.InvariantCulture), "[Script Info]", sub.Header);
|
sub.Header = AdvancedSubStationAlpha.AddTagToHeader("PlayResY", "PlayResY: " + resolution.Value.Y.ToString(CultureInfo.InvariantCulture), "[Script Info]", sub.Header);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
FileUtil.WriteAllText(outputFileName, sub.ToText(sf), targetEncoding);
|
FileUtil.WriteAllText(outputFileName, sub.ToText(sf), targetEncoding);
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Thread.Sleep(100);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileUtil.WriteAllText(outputFileName, sub.ToText(sf), targetEncoding);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Thread.Sleep(500);
|
||||||
|
FileUtil.WriteAllText(outputFileName, sub.ToText(sf), targetEncoding);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user