Fix rule processing loop
This commit is contained in:
parent
36b167d335
commit
492c2404cd
1 changed files with 4 additions and 2 deletions
|
@ -106,8 +106,10 @@ async function applyAiRules(idsInput) {
|
||||||
try {
|
try {
|
||||||
const full = await messenger.messages.getFull(id);
|
const full = await messenger.messages.getFull(id);
|
||||||
const text = buildEmailText(full);
|
const text = buildEmailText(full);
|
||||||
const cacheKey = await sha256Hex(`${id}|${rule.criterion}`);
|
|
||||||
const matched = await AiClassifier.classifyText(text, rule.criterion, cacheKey);
|
for (const rule of aiRules) {
|
||||||
|
const cacheKey = await sha256Hex(`${id}|${rule.criterion}`);
|
||||||
|
const matched = await AiClassifier.classifyText(text, rule.criterion, cacheKey);
|
||||||
if (matched) {
|
if (matched) {
|
||||||
for (const act of (rule.actions || [])) {
|
for (const act of (rule.actions || [])) {
|
||||||
if (act.type === 'tag' && act.tagKey) {
|
if (act.type === 'tag' && act.tagKey) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue