summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author秋葉 <ambiguous404@gmail.com>2019-02-02 23:27:56 +0800
committerAlex Grönholm <alex.gronholm@nextday.fi>2019-02-02 17:27:56 +0200
commit8a174843acb499d7f327cc49efa4e47bdddeb8da (patch)
tree4d164ad508c88af80c0acbf42a004675710948ce
parentc15d1e8a824df3b0bb63ebd40a2ef587dbfb7177 (diff)
downloadapscheduler-8a174843acb499d7f327cc49efa4e47bdddeb8da.tar.gz
Removed duplicate if statement (#359)
-rw-r--r--apscheduler/schedulers/base.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/apscheduler/schedulers/base.py b/apscheduler/schedulers/base.py
index c80f4c6..8e71154 100644
--- a/apscheduler/schedulers/base.py
+++ b/apscheduler/schedulers/base.py
@@ -598,14 +598,13 @@ class BaseScheduler(six.with_metaclass(ABCMeta)):
"""
jobstore_alias = None
with self._jobstores_lock:
+ # Check if the job is among the pending jobs
if self.state == STATE_STOPPED:
- # Check if the job is among the pending jobs
- if self.state == STATE_STOPPED:
- for i, (job, alias, replace_existing) in enumerate(self._pending_jobs):
- if job.id == job_id and jobstore in (None, alias):
- del self._pending_jobs[i]
- jobstore_alias = alias
- break
+ for i, (job, alias, replace_existing) in enumerate(self._pending_jobs):
+ if job.id == job_id and jobstore in (None, alias):
+ del self._pending_jobs[i]
+ jobstore_alias = alias
+ break
else:
# Otherwise, try to remove it from each store until it succeeds or we run out of
# stores to check