DigiSkimmer
DigiSkimmer copied to clipboard
Let DS keep free Kiwi slots enhancement
As an enhancement I would vote for the following:
- Define a minimum of free slots per RX in the config
- Before starting a new worker, check KiwiSDRs /status and pull "users" and "max_users"
- If max_users - users < minimum_free_slots, put DS to sleep for a while
This way, we could let DigiSkimmer run on an idle receiver but keep a slot free if the RX is getting really busy during "rush hour"
I am not advanced enough to find the right spots to implement and do a PR. As an example I did it like that in the run method of KiwiWorker:
`# check if enough slots free for digiskr parsed_list = {} min_free_ports = 2 url = "http://"+str(self._options.server_host)+":"+str(self._options.server_port)+"/status" print("Asking " + url + " for free ports") response = urlopen(url) string = response.read().decode('utf-8') list_string = string.split('\n')
for item in list_string:
if item:
key, value = item.split("=")
parsed_list[key] = value
if int(parsed_list['users_max']) < int(parsed_list['users']) + min_free_ports:
print("not enough free slots")
self.connect_count -= 1
if self._options.connect_timeout > 0:
self._event.wait(timeout = self._options.connect_timeout)
`
Please excuse for the beginner style python. I didn't find the right spot to check users on every freq change, but maybe you get the idea and I am sure this could be useful for others as well.