Hello Tibor,

> I'll try to follow the if-then-else logic to see why it does not obey
> the CFG_BIBSCHED_REFRESHTIME value or maybe there is an exception that
> causes the logic to miss the time.sleep function.

Found!  The attached trivial patch fixes it.  I don't fully understand
the old reason to put the time.sleep() in a else loop clause; maybe it
was an overoptimization.  I think that it is easier to understand now.

Thanks for your help,

Ferran
commit fe7c2f30e69919badae8f3ead33439c98d197d09
Author: Ferran Jorba <[email protected]>
Date:   Thu Feb 28 15:43:23 2013 +0100

    Make sure to sleep while in main loop
    
    Simplify logic in bibsched main loop so it doesn't enter in a continuous
    loop eating all available resources.

diff --git a/modules/bibsched/lib/bibsched.py b/modules/bibsched/lib/bibsched.py
index af2f10c..99829b6 100644
--- a/modules/bibsched/lib/bibsched.py
+++ b/modules/bibsched/lib/bibsched.py
@@ -1316,8 +1316,7 @@ class BibSched(object):
                         elif self.handle_task(*task):
                             ## Something has changed
                             break
-                    else:
-                        time.sleep(CFG_BIBSCHED_REFRESHTIME)
+                time.sleep(CFG_BIBSCHED_REFRESHTIME)
         except Exception, err:
             register_exception(alert_admin=True)
             try:

Reply via email to