Avoid creating unneeded Context and Event objects when firing events (#113798)

* Avoid creating unneeded Context and Event objects when firing events

* Add test

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Erik Montnemery 2024-03-20 09:40:06 +01:00 committed by GitHub
parent 638020f168
commit d31124d5d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 257 additions and 128 deletions

View file

@ -321,7 +321,7 @@ class Events(Base):
EventOrigin(self.origin)
if self.origin
else EVENT_ORIGIN_ORDER[self.origin_idx or 0],
dt_util.utc_from_timestamp(self.time_fired_ts or 0),
self.time_fired_ts or 0,
context=context,
)
except JSON_DECODE_EXCEPTIONS: