Add counter for "browser" fallback usage

Helps with #63
This commit is contained in:
MICHAEL JACKSON
2017-11-15 07:30:05 -05:00
parent 3f2192f7d4
commit a9497166fe
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,15 @@
const db = require('../../RedisClient')
function incrementCounter(counter, key, by) {
return new Promise((resolve, reject) => {
db.hincrby(counter, key, by, (error, value) => {
if (error) {
reject(error)
} else {
resolve(value)
}
})
})
}
module.exports = incrementCounter