mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-04-27 14:20:35 +00:00
Fixed typos. Fixed missing lock.
This commit is contained in:
parent
7d502306ea
commit
a8b519e06e
1 changed files with 9 additions and 8 deletions
|
|
@ -361,15 +361,16 @@ class ReticulumGitNode():
|
||||||
if self.announce_interval and time.time() > self.last_announce + self.announce_interval: self.announce()
|
if self.announce_interval and time.time() > self.last_announce + self.announce_interval: self.announce()
|
||||||
if time.time() > self.last_link_clean + self.link_clean_interval:
|
if time.time() > self.last_link_clean + self.link_clean_interval:
|
||||||
stale_links = []
|
stale_links = []
|
||||||
for link_id in self.active_links:
|
with self.active_links_lock:
|
||||||
link = self.active_links[link_id]
|
for link_id in self.active_links:
|
||||||
if not link.status == RNS.Link.ACTIVE: stale_links.append(link_id)
|
link = self.active_links[link_id]
|
||||||
|
if not link.status == RNS.Link.ACTIVE: stale_links.append(link_id)
|
||||||
|
|
||||||
cleaned_links = 0
|
cleaned_links = 0
|
||||||
for link_id in stale_links:
|
for link_id in stale_links:
|
||||||
link = None
|
link = None
|
||||||
with self.active_links_lock:
|
with self.active_links_lock:
|
||||||
if link_id in stale_links:
|
if link_id in self.active_links:
|
||||||
link = self.active_links.pop(link_id)
|
link = self.active_links.pop(link_id)
|
||||||
cleaned_links += 1
|
cleaned_links += 1
|
||||||
|
|
||||||
|
|
@ -413,10 +414,10 @@ class ReticulumGitNode():
|
||||||
|
|
||||||
def register_request_handlers(self):
|
def register_request_handlers(self):
|
||||||
ga_list = self.global_allowed_list if self.global_allow == RNS.Destination.ALLOW_LIST else None
|
ga_list = self.global_allowed_list if self.global_allow == RNS.Destination.ALLOW_LIST else None
|
||||||
self.destination.register_request_handler(self.PATH_LIST, self.handle_list, allow=self.global_allow, allowed_list=ga_list)
|
self.destination.register_request_handler(self.PATH_LIST, self.handle_list, allow=self.global_allow, allowed_list=ga_list)
|
||||||
self.destination.register_request_handler(self.PATH_FETCH, self.handle_fetch, allow=self.global_allow, allowed_list=ga_list)
|
self.destination.register_request_handler(self.PATH_FETCH, self.handle_fetch, allow=self.global_allow, allowed_list=ga_list)
|
||||||
self.destination.register_request_handler(self.PATH_PUSH, self.handle_push, allow=self.global_allow, allowed_list=ga_list)
|
self.destination.register_request_handler(self.PATH_PUSH, self.handle_push, allow=self.global_allow, allowed_list=ga_list)
|
||||||
self.destination.register_request_handler(self.PATH_DELETE, self.handle_list, allow=self.global_allow, allowed_list=ga_list)
|
self.destination.register_request_handler(self.PATH_DELETE, self.handle_delete, allow=self.global_allow, allowed_list=ga_list)
|
||||||
|
|
||||||
def remote_connected(self, link):
|
def remote_connected(self, link):
|
||||||
RNS.log(f"Peer connected to {self.destination}", RNS.LOG_DEBUG)
|
RNS.log(f"Peer connected to {self.destination}", RNS.LOG_DEBUG)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue