Is the wait time at the start of Device.open() necessary?
I'm not sure if this is the right place to ask these questions but I also wouldn't say it's a bug. I was having long wait times for a simple cli script and I ended up narrowing it down to the first line of the Device.open() function, which adds 5 seconds of wait time at the start for seemingly no reason, so in the best case scenario getting the device info for a single connected device takes 5 seconds. The rest of the code only seems to call sleep() to add delays after exceptions, which makes more sense to me than doing it preemptively.
Is there a point to calling sleep at the start of the function? For a single device 5 seconds might not be that much, but when running cli.py(
The relevant code in src/calibre/
class Device(
...
def open(self, connected_device, library_uuid):
...
I commented the first line of the function and everything seems to work fine, but I wanted to know if there's reason not to do so. At the very least, I'd like to know if the delay could be shorter.
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Ubuntu calibre Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: