mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
only schedule sessions for testing if they aren't already scheduled for testing
This commit is contained in:
parent
9cebf1e268
commit
ed9a02af65
1 changed files with 9 additions and 3 deletions
|
|
@ -109,9 +109,15 @@ class session(object):
|
|||
|
||||
def request_test(self):
|
||||
"""Ask a daemon to test challenges."""
|
||||
# TODO: check whether this session is already in pending-testchallenge?
|
||||
sessions.lpush("pending-testchallenge", self.id)
|
||||
sessions.publish("requests", "testchallenge")
|
||||
# There is a race condition between testing for membership and
|
||||
# adding it, but it's quite difficult to "exploit" and the result
|
||||
# of triggering it is just that the same session will be scheduled
|
||||
# for testing twice. We use locking in the daemon to exclude the
|
||||
# possibility of two daemon processes testing the same session at
|
||||
# once, and check the session's state before beginning to test it.
|
||||
if self.id not in sessions.lrange("pending-testchallenge", 0, -1):
|
||||
sessions.lpush("pending-testchallenge", self.id)
|
||||
sessions.publish("requests", "testchallenge")
|
||||
|
||||
def request_made(self):
|
||||
"""Has there already been a signing request made in this session?"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue