Implement ChanKeep joining functions

* Low-key channel joining with incrementally increasing delay
* Spin up needed instances to be able to cover a certain channel space
* Fix provisioning functions to prevent race conditions with lots of
relays being created at once
* Tweakable switchover from covering all channels to only covering
channels with more users than the mean of the cumulative user count
This commit is contained in:
2019-10-11 13:07:57 +01:00
parent c3d0cb04b6
commit 7a6e3338c0
7 changed files with 126 additions and 37 deletions

View File

@@ -17,14 +17,16 @@ class Network:
self.security = security
self.auth = auth
self.last = 0
self.last = 1
self.relays = {}
self.aliases = {}
def add_relay(self, num=None):
if not num:
self.last += 1
num = self.last
self.last += 1
elif num == self.last:
self.last += 1
self.relays[num] = {
"enabled": main.config["ConnectOnCreate"],
"net": self.net,