From 10f3ea15504434b7dbee161e7d1bc333666647fb Mon Sep 17 00:00:00 2001 From: tomnkey Date: Fri, 10 May 2024 14:36:20 +0800 Subject: [PATCH 1/2] fix RedisJobStore .add_job() .update_job() param error redis zadd function score pairs should be specified in two ways: - As *args, in the form of: name1, score1, name2, score2, ... - or as **kwargs, in the form of: name1=score1, name2=score2, ... --- apscheduler/jobstores/redis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apscheduler/jobstores/redis.py b/apscheduler/jobstores/redis.py index 5bb69d635..3b7e787c6 100644 --- a/apscheduler/jobstores/redis.py +++ b/apscheduler/jobstores/redis.py @@ -82,7 +82,7 @@ def add_job(self, job): self.pickle_protocol)) if job.next_run_time: pipe.zadd(self.run_times_key, - {job.id: datetime_to_utc_timestamp(job.next_run_time)}) + **{job.id: datetime_to_utc_timestamp(job.next_run_time)}) pipe.execute() @@ -95,7 +95,7 @@ def update_job(self, job): self.pickle_protocol)) if job.next_run_time: pipe.zadd(self.run_times_key, - {job.id: datetime_to_utc_timestamp(job.next_run_time)}) + **{job.id: datetime_to_utc_timestamp(job.next_run_time)}) else: pipe.zrem(self.run_times_key, job.id) From d4f9e0be9abb8e4f04b76da78c20935c0f690137 Mon Sep 17 00:00:00 2001 From: tomnkey Date: Fri, 10 May 2024 14:54:27 +0800 Subject: [PATCH 2/2] Update test_schedulers.py --- tests/test_schedulers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_schedulers.py b/tests/test_schedulers.py index 48d04e01f..f1e04eb47 100644 --- a/tests/test_schedulers.py +++ b/tests/test_schedulers.py @@ -1051,8 +1051,7 @@ def scheduler(self, coreapp): return qt.QtScheduler() def wait_event(self, queue): - from PySide6.QtCore import QCoreApplication - + QCoreApplication = pytest.importorskip('PySide6.QtCore.QCoreApplication') while queue.empty(): QCoreApplication.processEvents() return queue.get_nowait()