Skip to content

Commit

Permalink
replace file removal log with decision tree stage (#3114)
Browse files Browse the repository at this point in the history
  • Loading branch information
SidSethi authored May 18, 2022
1 parent 9f0d44d commit 6576c98
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions creator-node/src/routes/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,10 @@ const getCID = async (req, res) => {

if (CID !== EMPTY_FILE_CID && fsStats.size === 0) {
// Remove file if it is empty and force fetch from CN network
req.logger.warn(`[new path] File is empty -- removing ${CID}`)
await fs.unlink(storagePath)
decisionTree.push({
stage: `EMPTY_FILE_FOUND_AND_REMOVED_NEW_PATH`
})
} else {
fileFoundOnFS = true
}
Expand Down Expand Up @@ -311,8 +313,10 @@ const getCID = async (req, res) => {
})
if (CID !== EMPTY_FILE_CID && fsStats.size === 0) {
// Remove file if it is empty and force fetch from CN network
req.logger.warn(`[legacy path] File is empty -- removing ${CID}`)
await fs.unlink(storagePath)
decisionTree.push({
stage: `EMPTY_FILE_FOUND_AND_REMOVED_LEGACY_PATH`
})
} else {
fileFoundOnFS = true
}
Expand Down

0 comments on commit 6576c98

Please sign in to comment.