move getting private_key/our_actor to __init__ (for main thread)
This commit is contained in:
parent
a48aececfd
commit
6959bba5f3
1 changed files with 8 additions and 6 deletions
|
@ -12,12 +12,6 @@ class Server(object):
|
|||
self.username = username
|
||||
self.instance = instance
|
||||
|
||||
self._request_queue = queue.Queue()
|
||||
self._request_thread = threading.Thread(target=self._request_loop)
|
||||
self._request_thread.daemon = True
|
||||
self._request_thread.start()
|
||||
|
||||
def _request_loop(self):
|
||||
url_for = self.exports.get_one("url-for")
|
||||
|
||||
key_id = self._ap_keyid_url(url_for)
|
||||
|
@ -28,6 +22,14 @@ class Server(object):
|
|||
|
||||
del url_for
|
||||
|
||||
self._request_queue = queue.Queue()
|
||||
self._request_thread = threading.Thread(target=self._request_loop,
|
||||
args=(private_key, our_actor))
|
||||
self._request_thread.daemon = True
|
||||
self._request_thread.start()
|
||||
|
||||
def _request_loop(self, private_key, our_actor):
|
||||
|
||||
while True:
|
||||
obj = self._request_queue.get()
|
||||
if obj == "kill":
|
||||
|
|
Loading…
Reference in a new issue