mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
bugfix #152: add key to fsUUIDs periodically
This commit is contained in:
@@ -104,8 +104,14 @@ module.exports = (logger) => {
|
|||||||
const {srf} = require('../..');
|
const {srf} = require('../..');
|
||||||
const {addToSet} = srf.locals.dbHelpers;
|
const {addToSet} = srf.locals.dbHelpers;
|
||||||
const uuid = srf.locals.fsUUID = uuidv4();
|
const uuid = srf.locals.fsUUID = uuidv4();
|
||||||
addToSet(FS_UUID_SET_NAME, uuid)
|
|
||||||
.catch((err) => logger.info({err}, `Error adding ${uuid} to set ${FS_UUID_SET_NAME}`));
|
/* in case redis is restarted, re-insert our key every so often */
|
||||||
|
setInterval(() => {
|
||||||
|
// eslint-disable-next-line max-len
|
||||||
|
addToSet(FS_UUID_SET_NAME, uuid).catch((err) => logger.info({err}, `Error adding ${uuid} to set ${FS_UUID_SET_NAME}`));
|
||||||
|
}, 30000);
|
||||||
|
// eslint-disable-next-line max-len
|
||||||
|
addToSet(FS_UUID_SET_NAME, uuid).catch((err) => logger.info({err}, `Error adding ${uuid} to set ${FS_UUID_SET_NAME}`));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user