Skip to content

Commit

Permalink
Merge pull request #1116 from imgbot/fix/clean_memory
Browse files Browse the repository at this point in the history
fix: deleting local repository clone after optimization
  • Loading branch information
GrigoreMihai authored Feb 23, 2022
2 parents e4c565d + c9c4f59 commit 4a48515
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CompressImagesFunction/CompressImages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,15 @@ public static bool Run(CompressimagesParameters parameters, ICollector<CompressI
});
}

try
{
Directory.Delete(parameters.LocalPath, true);
}
catch (Exception e)
{
logger.LogError(e, $"Delete issue with repository {parameters.LocalPath}");
}

return true;
}

Expand Down

0 comments on commit 4a48515

Please sign in to comment.