Skip to content

Commit 8b8b124

Browse files
committed
chore: fix hit counter
1 parent b650559 commit 8b8b124

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/controllers/shortlink.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ module.exports = function (app, passport) {
5151
const regex = new RegExp(`.*${req.params.id}$`, 'i')
5252
Collection.findOneAndUpdate(
5353
{ name: config.shortlinkCollectionName, 'links.url': regex },
54-
{ $inc: { 'links.$.hits': 1 } }
54+
{ $inc: { 'links.$.hits': 1 } },
55+
{},
56+
err => !!err && logger.error(err)
5557
)
5658

5759
return res.redirect(obj.url)

0 commit comments

Comments
 (0)