Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let DS keep free Kiwi slots enhancement #31

Open
doccodyblue opened this issue Jan 21, 2023 · 0 comments
Open

Let DS keep free Kiwi slots enhancement #31

doccodyblue opened this issue Jan 21, 2023 · 0 comments

Comments

@doccodyblue
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant