Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add delay before BundleRegistry.add_bundle
As discussed in SL#4841, when installing activities via system packages there is no guarantee that diretory contents are available yet even if the GFileMonitor has detected the directory creation. Therefore some delay before trying actually calling BundleRegistry add_bundle method. Plus, use a best-effort approach to cover different ranges of delay. Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
- Loading branch information
7743b90There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can use GLib.timeout_add_seconds(with 1, 10 and 100 values) given that is designed to cause less cpu wakeups:
http://pygtk.org/docs/pygobject/glib-functions.html#function-glib--timeout-add-seconds
7743b90There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though about it, but I want to use 100ms delay, and that is not possible with _seconds.
7743b90There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, what is the rationale to use 100ms delay?
7743b90There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minimum delay IMHO, but is just as arbitrary as any other number.
7743b90There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100 seconds would be too much, BTW.
7743b90There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine for 0.108.
Long term there should be a post-install notification method for an activity package to notify the shell, and control panel updaters should generate this signal instead of calling add bundle directly.