diff --git a/checkin_notes b/checkin_notes index 7803d54444..7a3e4a9b18 100755 --- a/checkin_notes +++ b/checkin_notes @@ -5837,6 +5837,8 @@ Karl 2003/08/18 sched/ transitioner.C make_work.C + lib/ + backend_lib.C py/boinc.py test/*.py diff --git a/py/boinc.py b/py/boinc.py index cd2f1af85e..7639323525 100644 --- a/py/boinc.py +++ b/py/boinc.py @@ -238,6 +238,8 @@ def num_wus(db, q=""): return db_query(db, "select count(*) from workunit "+q)[0]['count(*)'] def num_wus_assimilated(db): return num_wus(db, "where assimilate_state=%d"%ASSIMILATE_DONE) +def num_wus_to_transition(db): + return num_wus(db, "where transition_time<%d"%(time.time()+30*86400)) def query_yesno(str): '''Query user; default Yes''' diff --git a/test/testbase.py b/test/testbase.py index dad159ea8e..7ce91bfe4c 100644 --- a/test/testbase.py +++ b/test/testbase.py @@ -323,7 +323,7 @@ class TestProject(Project): time.sleep(5) def run_finish_wait(self): db = self.db_open() - while num_wus_assimilated(db) < num_wu: + while (num_wus_assimilated(db) < self.num_wu) or num_wus_to_transition(db): time.sleep(.5) def check(self): diff --git a/tools/backend_lib.C b/tools/backend_lib.C index fac1a1e235..c7d2bc8510 100644 --- a/tools/backend_lib.C +++ b/tools/backend_lib.C @@ -229,30 +229,14 @@ int create_work( strcpy(wu.result_template, _result_template); process_result_template_upload_url_only(wu.result_template, upload_url); + wu.transition_time = time(0); retval = wu.insert(); if (retval) { fprintf(stderr, "create_work: workunit.insert() %d\n", retval); return retval; } - wu.transition_time = time(0); wu.id = boinc_db_insert_id(); -#if 0 - char suffix[256]; - char result_template[MAX_BLOB_SIZE]; - int i; - for (i=0; i