diff options
author | Simon Westphahl <simon.westphahl@bmw.de> | 2023-01-04 13:35:34 +0100 |
---|---|---|
committer | Simon Westphahl <simon.westphahl@bmw.de> | 2023-01-04 14:06:36 +0100 |
commit | c8a554a8b6e6e65e2645c9df597b5b87ef0b6ed3 (patch) | |
tree | e00352f2f06b225f86fab107914788ec4f1f4980 /zuul | |
parent | cb40ddc7db83ddda48c5aede7e61e10b42d6845b (diff) | |
download | zuul-c8a554a8b6e6e65e2645c9df597b5b87ef0b6ed3.tar.gz |
Add timer event directly to pipeline event queues
Timer events are always generated for a particular pipeline and tenant.
Because of that we can directly add the timer triggers to the matching
pipeline event queue instead of taking a detour via the tenant trigger
event queue.
This will also eliminate duplicate events in cases where a project is
part of multiple tenants. This happened since the scheduler added the
event to all tenants that have the project configured that the event
refers to.
Change-Id: I6b4b77a82aac6d2c3441ace9f64dc9b4a80c5856
Diffstat (limited to 'zuul')
-rw-r--r-- | zuul/driver/timer/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/zuul/driver/timer/__init__.py b/zuul/driver/timer/__init__.py index 37fdcf580..57cf999a3 100644 --- a/zuul/driver/timer/__init__.py +++ b/zuul/driver/timer/__init__.py @@ -234,7 +234,9 @@ class TimerDriver(Driver, TriggerInterface): event=event) log = get_annotated_logger(self.log, event) log.debug("Adding event") - self.sched.addTriggerEvent(self.name, event) + self.sched.pipeline_trigger_events[tenant.name][ + pipeline_name + ].put(self.name, event) except Exception: self.log.exception("Error dispatching timer event for " "tenant %s project %s branch %s", |