[packagekit] scheduling of tasks

Richard Hughes hughsient at gmail.com
Thu Aug 30 13:29:31 PDT 2007


On 30/08/2007, Ken VanDine <ken at vandine.org> wrote:
> Thing like checking for updates and refreshing the cache will surely
> be configurable at some point.  Should we touch a file somewhere for
> each task so we know when the event finished last?  For example, we
> shouldn't be doing a refresh and a get-updates at the same time each
> time pk-update-icon starts.  What if the user wants to check daily for
> updates, but then reboots a couple times a day... waste.

Yes, this is the reason we have a b=force flag to RefreshCache, i.e.
TRUE means "I know it's been recently, I really mean it" and FALSE
means "refresh if you think it needs it, now is a good time".

> I was thinking checking the mtime on /var/cache/PackageKit/{refresh,get-updates}

We don't need to do this for get-updates as this should be quick and
won't need network access. If ther user is rebooting we also need to
populate the list in the client, so we can't cache this.

We do need this for refresh. Maybe a method in src/pk-task-common.c
pk_task_get_time_last_refreshed() and
pk_task_save_time_last_refreshed() which the specific backend compiled
file can do what it thinks best.

But sure, the concept is sound, as the daemon keeps coming and going.

Richard.



More information about the PackageKit mailing list