Skip to content

Commit c5aa574

Browse files
Update schedule.md
1 parent 44c5748 commit c5aa574

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

schedule.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,10 @@ Take for example, you want to run a Cron to delete stuff, one potential optimiza
5353
You can do so by querying all future items to delete within the next hour, and then aggregate the IDs by the expired at date up to a minute granularity.
5454

5555
You can then schedule the Cron for the upcoming expiring minutes to clear the rows in the database.
56+
57+
58+
# scheduling and data race
59+
60+
Scheduling work will always be prone to data race. Your state might change, or the rows may have already been deleted. As such, all operations must best be idempotent.
61+
62+
Care must be taken for changes that involves state transition. Always guard your transition so that states can't be shifted backwards

0 commit comments

Comments
 (0)