summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2022-02-10 00:40:16 +0200
committerAlex Grönholm <alex.gronholm@nextday.fi>2022-02-10 00:41:09 +0200
commit425849341fb68aafdcb4ef75b7d2710e18f21722 (patch)
tree6313164973975389692eae7423d0cd4ccc27328e
parent222ba495202c02977a1af97709dc83d1f8d7cc44 (diff)
downloadapscheduler-425849341fb68aafdcb4ef75b7d2710e18f21722.tar.gz
Fixed RuntimeError when shutting down the scheduler from a scheduled job
Fixes #285.
-rw-r--r--apscheduler/schedulers/base.py5
-rw-r--r--docs/versionhistory.rst2
2 files changed, 4 insertions, 3 deletions
diff --git a/apscheduler/schedulers/base.py b/apscheduler/schedulers/base.py
index 3dfb743..444de8e 100644
--- a/apscheduler/schedulers/base.py
+++ b/apscheduler/schedulers/base.py
@@ -191,12 +191,11 @@ class BaseScheduler(six.with_metaclass(ABCMeta)):
self.state = STATE_STOPPED
# Shut down all executors
- with self._executors_lock:
+ with self._executors_lock, self._jobstores_lock:
for executor in six.itervalues(self._executors):
executor.shutdown(wait)
- # Shut down all job stores
- with self._jobstores_lock:
+ # Shut down all job stores
for jobstore in six.itervalues(self._jobstores):
jobstore.shutdown()
diff --git a/docs/versionhistory.rst b/docs/versionhistory.rst
index 7c2933b..b7b8fc2 100644
--- a/docs/versionhistory.rst
+++ b/docs/versionhistory.rst
@@ -10,6 +10,8 @@ UNRELEASED
* No longer enforce pytz time zones (support for others is experimental in the 3.x series)
* Fixed compatibility with PyMongo 4
* Fixed pytz deprecation warnings
+* Fixed RuntimeError when shutting down the scheduler from a scheduled job
+
3.8.1
-----