0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Fixed verification trigger for imports

refs: https://github.com/TryGhost/Toolbox/issues/293

This import verification check now works by testing all imports in the last 30 days.
This commit is contained in:
Sam Lord 2022-04-14 16:04:26 +01:00
parent dec282345f
commit 5d62758e64

View file

@ -58,17 +58,9 @@ const membersImporter = new MembersCSVImporter({
const processImport = async (options) => {
const result = await membersImporter.process(options);
const importSize = result.meta.originalImportSize;
delete result.meta.originalImportSize;
const importThreshold = await verificationTrigger.getImportThreshold();
if (importSize > importThreshold) {
await verificationTrigger.startVerificationProcess({
amountImported: importSize,
throwOnTrigger: true,
source: 'import'
});
}
// Check whether all imports in last 30 days > threshold
await verificationTrigger.testImportThreshold();
return result;
};