Conversation
|
Preview for this PR was built for commit |
sources/platform/actors/development/builds_and_runs/state_persistence.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/builds_and_runs/state_persistence.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/builds_and_runs/state_persistence.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/builds_and_runs/state_persistence.md
Outdated
Show resolved
Hide resolved
|
Preview for this PR was built for commit |
…istence.md Co-authored-by: Michał Olender <92638966+TC-MO@users.noreply.github.com>
fedaa28 to
5f9cd6d
Compare
|
Preview for this PR was built for commit |
|
Preview for this PR was built for commit |
metalwarrior665
left a comment
There was a problem hiding this comment.
Nice, much cleaner now
sources/platform/actors/development/builds_and_runs/state_persistence.md
Show resolved
Hide resolved
|
Preview for this PR was built for commit |
|
Preview for this PR was built for commit |
TC-MO
left a comment
There was a problem hiding this comment.
One suggestion for clarity, otherwise LGTM
| ## Implement state persistence | ||
|
|
||
| To manually persist state, use the `Actor.on` method in the Apify SDK: | ||
| Use the [`Actor.useState()`](/sdk/js/reference/class/Actor#useState)/[`Actor.use_state()`](/sdk/python/reference/class/Actor#use_state) method to persist state across migrations. This method automatically saves your state to the key-value store and restores it when the Actor restarts. |
There was a problem hiding this comment.
Just a suggestion for better clarity?
| Use the [`Actor.useState()`](/sdk/js/reference/class/Actor#useState)/[`Actor.use_state()`](/sdk/python/reference/class/Actor#use_state) method to persist state across migrations. This method automatically saves your state to the key-value store and restores it when the Actor restarts. | |
| Use the JS SDK's [`Actor.useState()`](/sdk/js/reference/class/Actor#useState) or Python SDK's [`Actor.use_state()`](/sdk/python/reference/class/Actor#use_state) methods to persist state across migrations. This method automatically saves your state to the key-value store and restores it when the Actor restarts. |
Note
Refines guidance on Actor state persistence.
Actor.useStatefor automatic state save/restore during migrationsActor.on()migratingevent and retrieval withActor.getValue/Actor.get_value, noting Python usagestate_persistence.md; no code changesWritten by Cursor Bugbot for commit c9753ae. Configure here.