Skip to content

Commit

Permalink
Fix/reschedule in n days affects manually rescheduled cards
Browse files Browse the repository at this point in the history
  • Loading branch information
L-M-Sherlock committed Jun 12, 2024
1 parent 18e9ec3 commit e51d926
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion 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 @@ -233,7 +234,15 @@ def reschedule_background(
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})"
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:
Expand Down

0 comments on commit e51d926

Please sign in to comment.