Merge branch 'master' of https://github.com/microsoft/Recurring-Integrations-Scheduler
This commit is contained in:
Коммит
aa86239565
|
@ -34,16 +34,22 @@ namespace RecurringIntegrationsScheduler.Common.Helpers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="filePath">File path</param>
|
/// <param name="filePath">File path</param>
|
||||||
/// <returns>Stream</returns>
|
/// <returns>Stream</returns>
|
||||||
public static Stream Read(string filePath)
|
public static Stream Read(string filePath, FileShare fileShare = FileShare.ReadWrite)
|
||||||
{
|
{
|
||||||
if (File.Exists(filePath))
|
if (File.Exists(filePath))
|
||||||
{
|
{
|
||||||
return new FileStream(filePath,
|
try
|
||||||
FileMode.Open,
|
{
|
||||||
FileAccess.ReadWrite,
|
return new FileStream(filePath,
|
||||||
FileShare.ReadWrite,
|
FileMode.Open,
|
||||||
4096,
|
FileAccess.ReadWrite,
|
||||||
true);
|
fileShare,
|
||||||
|
4096,
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
catch (IOException)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,7 @@ namespace RecurringIntegrationsScheduler.Job
|
||||||
}
|
}
|
||||||
fileCount++;
|
fileCount++;
|
||||||
|
|
||||||
var sourceStream = _retryPolicyForIo.Execute(() => FileOperationsHelper.Read(dataMessage.FullPath));
|
var sourceStream = _retryPolicyForIo.Execute(() => FileOperationsHelper.Read(dataMessage.FullPath, FileShare.None));
|
||||||
if (sourceStream == null) continue;//Nothing to do here
|
if (sourceStream == null) continue;//Nothing to do here
|
||||||
|
|
||||||
sourceStream.Seek(0, SeekOrigin.Begin);
|
sourceStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче