Skip to content

Commit

Permalink
fix(preprocessor): renamed handeFile to readFileCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
ywongau committed May 30, 2017
1 parent 2789bf5 commit 92a8c81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/preprocessor.js
Expand Up @@ -77,13 +77,13 @@ var createPreprocessor = function (config, basePath, injector) {
patterns = Object.keys(config)
var retryCount = 0
var maxRetries = 3
function handleFile (err, buffer) {
function readFileCallback (err, buffer) {
if (err) {
log.warn(err)
if (retryCount < maxRetries) {
retryCount++
log.warn('retrying ' + retryCount)
fs.readFile(file.originalPath, handleFile)
fs.readFile(file.originalPath, readFileCallback)
return
} else {
throw err
Expand Down Expand Up @@ -131,7 +131,7 @@ var createPreprocessor = function (config, basePath, injector) {
nextPreprocessor(null, thisFileIsBinary ? buffer : buffer.toString())
})
}
return fs.readFile(file.originalPath, handleFile)
return fs.readFile(file.originalPath, readFileCallback)
}
}
createPreprocessor.$inject = ['config.preprocessors', 'config.basePath', 'injector']
Expand Down

0 comments on commit 92a8c81

Please sign in to comment.