Negative time doesn't make sense. If next_check_time is <= 0, isn't it time to check right now?
If the time_until_next_check is < refresh_period, I think we should simply perform the check and then set next_check to now + refresh_period. I think that would make this a little easier to follow. -j On Mon, Nov 17, 2008 at 06:01:14PM -0800, Brock Pytlik wrote: > Ok, then since we've observed time can be negative, that's the right > delay in this situation? Would replacing 0 with 10 make everyone happy? > > Brock > > jmr wrote: > > Brock if we ever hit next_check_time < 0 and set next_check_time = 0: > > > > 333 + if next_check_time < 0: > > 334 + next_check_time = 0 > > > > Then you will go into a spin in the call to: > > 337 + gobject.timeout_add(0, self.do_next_check) > > > > This is what was happening in the bug we tracked down last week. > > > > JR > > > > Brock Pytlik wrote: > >> Webrev: > >> http://cr.opensolaris.org/~bpytlik/ips-5171-v1/ > >> > >> Bug: > >> http://defect.opensolaris.org/bz/show_bug.cgi?id=5171 > >> Updatemanager eating 50% of the CPU > >> > >> This changes so that the next check to check for updates isn't > >> scheduled until after the current check for updates happens. > >> > >> Brock > >> _______________________________________________ > >> pkg-discuss mailing list > >> [email protected] > >> http://mail.opensolaris.org/mailman/listinfo/pkg-discuss > >> > > > > _______________________________________________ > pkg-discuss mailing list > [email protected] > http://mail.opensolaris.org/mailman/listinfo/pkg-discuss _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
