Skip to content

Commit

Permalink
crawl job bug fix: create directory if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
kreeben committed Oct 6, 2020
1 parent 345da10 commit e8f76bb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Sir.HttpServer/Features/CrawlJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,19 @@ private void DownloadAndIndexWetFile()
{
try
{
var localDir = Path.GetDirectoryName(localFileName);

if (!Directory.Exists(localDir))
{
Directory.CreateDirectory(localDir);
}

File.Move(tmpFileName, localFileName);
Directory.Delete(Path.GetDirectoryName(tmpFileName));
}
catch (Exception ex)
{
_logger.LogError(ex, "Could not move tmp wet file.");
_logger.LogError(ex, ex.Message);
}
}

Expand Down

0 comments on commit e8f76bb

Please sign in to comment.