Compare commits
2 Commits
0fdb9559f9
...
164f91eabd
Author | SHA1 | Date |
---|---|---|
|
164f91eabd | |
|
38c7487ccc |
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "traxxx-web",
|
||||
"version": "0.26.1",
|
||||
"version": "0.26.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"version": "0.26.1",
|
||||
"version": "0.26.2",
|
||||
"dependencies": {
|
||||
"@brillout/json-serializer": "^0.5.8",
|
||||
"@dicebear/collection": "^7.0.5",
|
||||
|
|
|
@ -78,5 +78,5 @@
|
|||
"postcss-custom-media": "^10.0.2",
|
||||
"postcss-nesting": "^12.0.2"
|
||||
},
|
||||
"version": "0.26.1"
|
||||
"version": "0.26.2"
|
||||
}
|
||||
|
|
|
@ -4,6 +4,13 @@ import initLogger from './logger.js';
|
|||
|
||||
const logger = initLogger();
|
||||
|
||||
const entityPrefixes = {
|
||||
channel: '',
|
||||
network: '_',
|
||||
studio: '*',
|
||||
info: '@',
|
||||
};
|
||||
|
||||
export function curateEntity(entity, context) {
|
||||
if (!entity) {
|
||||
return null;
|
||||
|
@ -136,7 +143,7 @@ export async function cacheEntityIds() {
|
|||
const entities = await knex('entities').select('id', 'slug', 'type');
|
||||
|
||||
await redis.del('traxxx:entities:id_by_slug');
|
||||
await redis.hSet('traxxx:entities:id_by_slug', entities.map((entity) => [entity.type === 'network' ? `_${entity.slug}` : entity.slug, entity.id]));
|
||||
await redis.hSet('traxxx:entities:id_by_slug', entities.map((entity) => [`${entityPrefixes[entity.type]}${entity.slug}`, entity.id]));
|
||||
|
||||
logger.info('Cached entity IDs by slug');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue