You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did this in my dal layer file
` const cache = new SequelizeSimpleCache({
License: { ttl: false }, // cache for 1 day
}, {
debug: true,
ops: 60, // seconds
});
let checkConnection = async function () {
try {
await sequelize.authenticate();
} catch (error) {
logger.error("Unable to connect to the database:", error);
throw error;
}
}; `
and the function is also in dal layer file only...
let getAllLicenses = async function () { let licenses = await LicenseCache.findAll(); return licenses; };
when i first call it it is a miss obviously and then it stores the data in cahce CACHE OPS { hit: 4, miss: 6, load: 6, purge: 0, ratio: 0.4, size: { License: 6 } }
but then after a few seconds it cleans the cache CACHE OPS { hit: 0, miss: 0, load: 0, purge: 0, ratio: NaN, size: { License: 0 } }
but ttl is false so cache should not be deleted
The text was updated successfully, but these errors were encountered:
I did this in my dal layer file
` const cache = new SequelizeSimpleCache({
License: { ttl: false }, // cache for 1 day
}, {
debug: true,
ops: 60, // seconds
});
let checkConnection = async function () {
try {
await sequelize.authenticate();
} catch (error) {
logger.error("Unable to connect to the database:", error);
throw error;
}
}; `
and the function is also in dal layer file only...
let getAllLicenses = async function () { let licenses = await LicenseCache.findAll(); return licenses; };
but. the cache initializes
CACHE INIT { type: 'License', ttl: false, methods: [ 'findOne', 'findAndCountAll', 'findByPk', 'findAll', 'count', 'min', 'max', 'sum', 'find', 'findAndCount', 'findById', 'findByPrimary', 'all' ], methodsUpdate: [ 'create', 'bulkCreate', 'update', 'destroy', 'upsert', 'findOrBuild', 'insertOrUpdate', 'findOrInitialize', 'updateAttributes' ], limit: 50, clearOnUpdate: true, hit: 0, miss: 0, load: 0, purge: 0, ratio: NaN, size: { License: 0 } }
when i first call it it is a miss obviously and then it stores the data in cahce
CACHE OPS { hit: 4, miss: 6, load: 6, purge: 0, ratio: 0.4, size: { License: 6 } }
but then after a few seconds it cleans the cache
CACHE OPS { hit: 0, miss: 0, load: 0, purge: 0, ratio: NaN, size: { License: 0 } }
but ttl is false so cache should not be deleted
The text was updated successfully, but these errors were encountered: