Skip to content

Commit

Permalink
Update lib/imageRouter/filesystem.js
Browse files Browse the repository at this point in the history
Co-authored-by: Max Wu <[email protected]>
  • Loading branch information
Yukaii and jackycute committed Jun 5, 2024
1 parent 12ed4f5 commit 0dcb1a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/imageRouter/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function randomFilename () {
*/
function pickFilename (defaultFilename) {
let retryCounter = 5
let filename = randomFilename()
const extname = path.extname(defaultFilename)
let filename = `${randomFilename()}${extname}`
while (retryCounter-- > 0) {
if (fs.existsSync(path.join(config.uploadsPath, filename))) {
filename = `${randomFilename()}${extname}`
Expand Down

0 comments on commit 0dcb1a9

Please sign in to comment.