mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
process rule sequentially
This commit is contained in:
parent
2c7a88de81
commit
29bbba48c5
1 changed files with 5 additions and 9 deletions
|
|
@ -222,8 +222,6 @@ const triggerActions = async (
|
|||
data: ItemEvent,
|
||||
ruleEventType: RuleEventType
|
||||
) => {
|
||||
const actionPromises: Promise<unknown>[] = []
|
||||
|
||||
for (const rule of rules) {
|
||||
let ast: LiqeQuery
|
||||
let results: (ItemEvent | LibraryItem)[]
|
||||
|
|
@ -276,15 +274,13 @@ const triggerActions = async (
|
|||
ruleEventType,
|
||||
}
|
||||
|
||||
actionPromises.push(actionFunc(actionObj))
|
||||
try {
|
||||
await actionFunc(actionObj)
|
||||
} catch (error) {
|
||||
logger.error('Error triggering rule action', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await Promise.all(actionPromises)
|
||||
} catch (error) {
|
||||
logger.error('Error triggering rule actions', error)
|
||||
}
|
||||
}
|
||||
|
||||
export const triggerRule = async (jobData: TriggerRuleJobData) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue