Fix linting errors

Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
This commit is contained in:
Yukai Huang 2020-02-06 10:46:48 +08:00
parent 8cd9ba2f82
commit 821295ecd3
No known key found for this signature in database
GPG Key ID: A76CBD50B22052C0
1 changed files with 2 additions and 5 deletions

View File

@ -38,7 +38,7 @@ async function checkVersion (ctx) {
return
}
let locals = ctx.locals ? ctx.locals : ctx.app.locals
const locals = ctx.locals ? ctx.locals : ctx.app.locals
locals.versionInfo.latest = data.latest
locals.versionInfo.versionItem = data.latest ? null : data.versionItem
@ -48,14 +48,10 @@ async function checkVersion (ctx) {
logger.warn(`Your CodiMD version is out of date! The latest version is ${version}. Please see what's new on ${link}.`)
}
return
} catch (err) {
// ignore and skip version check
logger.error('Version check failed.')
logger.error(err)
return
}
}
@ -65,6 +61,7 @@ exports.versionCheckMiddleware = function (req, res, next) {
next()
})
.catch((err) => {
logger.error(err)
next()
})
}