-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotcakes.Web.Images.ShrinkImageFileOnDisk temp files doesn't get deleted #320
Comments
What version of Hotcakes is this? I only ask because a more recent release does this for you on a scheduled basis. |
Ours is 3.2.1
Didn't check if scheduled clearance is present here, but it wouldn't solve
the problem anyway, as sometimes we need to do a full update of all our
products(given amount of the products we have, it breaks far before all products are processed).
…On Thu, Oct 15, 2020 at 9:06 PM Will Strohl ***@***.***> wrote:
What version of Hotcakes is this? I only ask because a more recent release
does this for you on a scheduled basis.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#320 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADM2JKJ3VVZIDT2ZCUKGKSDSK423RANCNFSM4SSG5JPQ>
.
|
How many products does your store have? At which point (approximately) does this appear to break in your instance? |
It's a multi-portal project,there are roughly 140k products in total. The
actual point is hard to tell,as it depends on too many things,but
anyway,judging by the MDSN doc,it should happen when up to 65535 calls are
done to the function.
…On Fri, Oct 16, 2020 at 8:29 PM Will Strohl ***@***.***> wrote:
How many products does your store have? At which point (approximately)
does this appear to break in your instance?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#320 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADM2JKM5XM3YOU6EBOTAGMLSLB7HLANCNFSM4SSG5JPQ>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to use the software in environment having more than 100k products we got into the following issue. The problem is in the function
public static void ShrinkImageFileOnDisk(string originalFile, string newFileName, int maxWidth, int maxHeight) { var tempFile = TempFiles.GetTemporaryFileInfo(); var settings = new ResizeSettings(maxWidth, maxHeight, FitMode.Max, null); ImageBuilder.Current.Build(originalFile, tempFile.FullName, settings); if (File.Exists(newFileName)) { File.SetAttributes(newFileName, FileAttributes.Normal); File.Delete(newFileName); } File.Copy(tempFile.FullName, newFileName); }
The tempFile is never got deleted which causes futher calls to ShrinkImageFileOnDisk to fail with exception:
Method:Hotcakes.Web.TempFiles.GetTemporaryFileInfo
StackTrace:
Message:
System.ArgumentException: Unable to create temporary file: {0}The file exists.
at Hotcakes.Web.TempFiles.GetTemporaryFileInfo()
at Hotcakes.Web.Images.ShrinkImageFileOnDisk(String originalFile, String newFileName, Int32 maxWidth, Int32 maxHeight)
at Hotcakes.Commerce.Utilities.ImageProcessing.ShrinkImage(String originalFile, String outputDirectory, Int32 maxWidth, Int32 maxHeight)
Hotcakes.Web.TempFiles.GetTemporaryFileInfo() uses system Path.GetTempFileName, and MSDN clearly states:
"The GetTempFileName method will raise an IOException if it is used to create more than 65535 files without deleting previous temporary files."
The text was updated successfully, but these errors were encountered: