Skip to content

Commit 07e576e

Browse files
committed
Better comment
1 parent ad882f5 commit 07e576e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/apify/_actor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,9 @@ async def reboot(
851851
custom_after_sleep = self._configuration.metamorph_after_sleep
852852

853853
# Call all the listeners for the PERSIST_STATE and MIGRATING events, and wait for them to finish.
854+
# PERSIST_STATE listeners are called to allow the Actor to persist its state before the reboot.
855+
# MIGRATING listeners are called to allow the Actor to gracefully stop in-progress tasks before the reboot.
856+
# Typically, crawlers are listening for the MIIGRATING event to stop processing new requests.
854857
# We can't just emit the events and wait for all listeners to finish,
855858
# because this method might be called from an event listener itself, and we would deadlock.
856859
persist_state_listeners = chain.from_iterable(

0 commit comments

Comments
 (0)