You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sources/platform/actors/development/builds_and_runs/state_persistence.md
+52-5Lines changed: 52 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ Long-running [Actor](../../index.mdx) jobs may need to migrate between servers.
18
18
To prevent data loss, long-running Actors should:
19
19
20
20
- Periodically save (persist) their state.
21
-
-Listem for [migration events](/sdk/js/api/apify/class/PlatformEventManager)
21
+
-Listen for [migration events](/sdk/js/api/apify/class/PlatformEventManager)
22
22
- Check for persisted state when starting, allowing them to resume from where they left off.
23
23
24
24
For short-running Actors, the risk of restarts and the cost of repeated runs are low, so you can typically ignore state persistence.
@@ -51,7 +51,7 @@ By default, an Actor keeps its state in the server's memory. During a server swi
51
51
52
52
The [Apify SDKs](/sdk) handle state persistence automatically.
53
53
54
-
This is done using the `Actor.on()` method and the `migrating` event.
54
+
This is done using the `Actor.on()` method and the `migrating` event.
55
55
56
56
- The `migrating` event is triggered just before a migration occurs, allowing you to save your state.
57
57
- To retrieve previously saved state, you can use the [`Actor.getValue`](/sdk/js/reference/class/Actor#getValue)/[`Actor.get_value`](/sdk/python/reference/class/Actor#get_value) methods.
0 commit comments