Fixed ordering for always run events

This commit is contained in:
aewens 2020-03-16 16:56:10 -05:00
parent 680f7589f9
commit 05d00dfc83
2 changed files with 9 additions and 7 deletions

View File

@ -1 +1 @@
0.2.1
0.2.2

View File

@ -133,18 +133,20 @@ class Engine:
"""
for (using, mutation) in self._apply_mutations(raw):
# Run now if always run key is set
for ar_when in self._whens_always_run:
if ar_when in self.skip_whens:
continue
skip_whens.add(ar_when)
self._run_callback(ar_when, using, mutation)
for (key, value) in self._get_variables(mutation):
for using_when in self._whens_map[key]:
# Already been triggers, skip
if using_when in skip_whens:
continue
# Run now if always run key is set
if using_when in self._whens_always_run:
skip_whens.add(using_when)
self._run_callback(using_when, using, mutation)
continue
when = self._whens.get(using_when)
if when is None:
return None