linux: Lower initial power usage when iDevice isn't accessible

When starting up, we would try to connect to the iDevice repeatedly,
once a second. But the process takes between a quarter and half a
second, and is CPU heavy. Lower this timeout to once every 5 seconds to
reduce the initial CPU consumption.
This commit is contained in:
Bastien Nocera 2016-06-08 14:50:23 +02:00
parent 54dd83501a
commit 402640bee0

View file

@ -247,7 +247,7 @@ up_device_idevice_coldplug (UpDevice *device)
"has-history", TRUE,
NULL);
idevice->priv->start_id = g_timeout_add_seconds (1, (GSourceFunc) up_device_idevice_start_poll_cb,
idevice->priv->start_id = g_timeout_add_seconds (5, (GSourceFunc) up_device_idevice_start_poll_cb,
idevice);
g_source_set_name_by_id (idevice->priv->start_id,
"[upower] up_device_idevice_start_poll_cb (linux)");