END_TEST START_TEST(test_job_exists) { fail_unless(job_exists("0.napali") == false); fail_unless(job_exists("1.napali") == true); }
static int purge_check(edg_wll_Context ctx, edg_wll_JobStat *stat, time_t start, time_t *timeout) { int to_purge = 0; int i; edg_wll_JobStat *substat; if (timeout[stat->state] >=0 && stat->lastUpdateTime.tv_sec && start-stat->lastUpdateTime.tv_sec > timeout[stat->state] // job from this server && !check_strict_jobid(ctx, stat->jobId) // if subjob purge only when orphan && (!stat->parent_job || job_exists(ctx, stat->parent_job) == 0)) { to_purge = 1; } // check the whole collection yet if (to_purge && stat->children_num && stat->children_states) { for (i = 0; i < stat->children_num && stat->children_states[i].state != EDG_WLL_JOB_UNDEF; i++) { substat = stat->children_states + i; if (timeout[substat->state] >=0 && substat->lastUpdateTime.tv_sec && start-substat->lastUpdateTime.tv_sec > timeout[substat->state]) ; else { to_purge = 0; break; } } } return to_purge; }