Throttle (once every 10sec) last seen app
This commit is contained in:
parent
4b05bc014e
commit
694b6334c5
1 changed files with 3 additions and 2 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
*/
|
*/
|
||||||
const uuidv1 = require('uuid/v1')
|
const uuidv1 = require('uuid/v1')
|
||||||
const logger = require('../../../config/log')
|
const logger = require('../../../config/log')
|
||||||
|
const throttle = require('lodash/throttle')
|
||||||
const Common = require('shock-common')
|
const Common = require('shock-common')
|
||||||
const { Constants, Schema } = Common
|
const { Constants, Schema } = Common
|
||||||
|
|
||||||
|
|
@ -760,14 +761,14 @@ const saveChannelsBackup = async (backups, user, SEA) => {
|
||||||
/**
|
/**
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
const setLastSeenApp = () => {
|
const setLastSeenApp = throttle(() => {
|
||||||
const user = require('../Mediator').getUser()
|
const user = require('../Mediator').getUser()
|
||||||
|
|
||||||
return user
|
return user
|
||||||
.get(Key.PROFILE)
|
.get(Key.PROFILE)
|
||||||
.get(Key.LAST_SEEN_APP)
|
.get(Key.LAST_SEEN_APP)
|
||||||
.pPut(Date.now())
|
.pPut(Date.now())
|
||||||
}
|
}, 10000)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string[]} tags
|
* @param {string[]} tags
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue