def load_all_terms(): job_progress = JobProgress().get() terms_done = job_progress.get('terms_done', []) all_terms = berkeley.all_term_ids() while terms_done != all_terms: if len(terms_done) == len(all_terms): app.logger.error(f'Unexpected terms_done value; stopping load: {terms_done}') return term_id = next(t for t in all_terms if t not in terms_done) load_term(term_id) terms_done.append(term_id) JobProgress().update(f'Term {term_id} loaded', properties={'terms_done': terms_done})
def test_all_term_ids(self, app): assert berkeley.all_term_ids() == ['2178', '2175', '2172', '2168']