@autofleet/matmon 2.0.4-beta-2 → 2.0.4-beta-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17,8 +17,7 @@ const logger_1 = __importDefault(require("../logger"));
|
|
|
17
17
|
const util_1 = require("util");
|
|
18
18
|
const { AF_SERVICE_NAME } = process.env;
|
|
19
19
|
const ORM_CACHE_PREFIX = 'ormCache';
|
|
20
|
-
const INVALIDATION_HOOKS = ['
|
|
21
|
-
const BULK_HOOKS = ['beforeBulkUpdate', 'beforeBulkDestroy'];
|
|
20
|
+
const INVALIDATION_HOOKS = ['afterUpdate', 'afterDestroy'];
|
|
22
21
|
const generateInstanceKey = (name, id) => `${AF_SERVICE_NAME}:${ORM_CACHE_PREFIX}:${name}_${id}`;
|
|
23
22
|
const generateDependencyKey = (modelName, associationName, associationId) => `${AF_SERVICE_NAME}:${ORM_CACHE_PREFIX}:${modelName}_${associationName}_${associationId}_DEPENDENCIES`;
|
|
24
23
|
const getInstanceDependencyKeys = (modelOptions, instance) => newrelic_1.default.startSegment(`${ORM_CACHE_PREFIX}:getInstanceDependencyKeys`, true, () => {
|
|
@@ -156,7 +155,6 @@ class SequelizeAdapter {
|
|
|
156
155
|
}));
|
|
157
156
|
const model = this.getModel(modelOptions.name);
|
|
158
157
|
INVALIDATION_HOOKS.map(hook => model.addHook(hook, (instance, options) => handleTransactionHook(instance, options, instance => invalidateModelInstance(hook, instance))));
|
|
159
|
-
BULK_HOOKS.map(hook => model.addHook(hook, options => options.individualHook = true));
|
|
160
158
|
modelOptions.associations = this.getModelDependencies(modelOptions.name);
|
|
161
159
|
this.debug(`Adding Invalidations Hooks to ${modelOptions.name}'s associations`, { associations: modelOptions.associations });
|
|
162
160
|
modelOptions.associations.map((associationOptions) => {
|