diff --git a/schedule/reschedule.py b/schedule/reschedule.py index 8e6162c..de3f725 100644 --- a/schedule/reschedule.py +++ b/schedule/reschedule.py @@ -66,6 +66,7 @@ def set_load_balance(self, did_query=None): f"""SELECT (id/1000-{mw.col.sched.day_cutoff})/86400, count(distinct cid) FROM revlog WHERE ease > 0 + AND (type < 3 OR factor != 0) GROUP BY (id/1000-{mw.col.sched.day_cutoff})/86400""" ) } @@ -232,9 +233,15 @@ def reschedule_background( if recent: today_cutoff = mw.col.sched.day_cutoff day_before_cutoff = today_cutoff - (config.days_to_reschedule + 1) * 86400 - recent_query = ( - f"AND id IN (SELECT cid FROM revlog WHERE id >= {day_before_cutoff * 1000})" - ) + recent_query = f"""AND id IN + ( + SELECT cid + FROM revlog + WHERE id >= {day_before_cutoff * 1000} + AND ease > 0 + AND (type < 3 OR factor != 0) + ) + """ if filter_flag: filter_query = f"AND id IN {ids2str(filtered_cids)}"