Skip to content

Commit

Permalink
Fix/reschedule in n days affects manually rescheduled cards (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
L-M-Sherlock committed Jun 14, 2024
1 parent 18e9ec3 commit ed32cf8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions schedule/reschedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
)
}
Expand Down Expand Up @@ -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)}"
Expand Down

0 comments on commit ed32cf8

Please sign in to comment.