mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
better handle proxy cache rename error
This commit is contained in:
parent
b7720af330
commit
2dfb5fd1b8
@ -107,7 +107,13 @@ public class AssetMiddleware
|
||||
}
|
||||
|
||||
// after successfully write data to temporary file, rename it to proper asset filename
|
||||
File.Move(filePathTmp, filePath);
|
||||
try {
|
||||
File.Move(filePathTmp, filePath);
|
||||
} catch (System.IO.IOException) {
|
||||
// this can happen for example if two clients request the same file in the same time
|
||||
// TODO: avoid redundant download in those cases
|
||||
File.Delete(filePathTmp);
|
||||
}
|
||||
} else {
|
||||
await inputStream.CopyToAsync(context.Response.Body);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user