From 7d2a9a45725cb1c6acfa5f0a7675a9fce3bcded7 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Mon, 2 Jun 2025 13:50:28 +0200 Subject: [PATCH] [IMP] queue_job: use __slots__ for ChannelJob It decreases memory footprint when there's thousands of jobs to prioritize. --- queue_job/jobrunner/channels.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/queue_job/jobrunner/channels.py b/queue_job/jobrunner/channels.py index b1cee329f8..1cce46083c 100644 --- a/queue_job/jobrunner/channels.py +++ b/queue_job/jobrunner/channels.py @@ -173,6 +173,8 @@ class ChannelJob: """ + __slots__ = ("db_name", "channel", "uuid", "seq", "date_created", "priority", "eta") + def __init__(self, db_name, channel, uuid, seq, date_created, priority, eta): self.db_name = db_name self.channel = channel