New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Use .reboot()
instead of .metamorph()
for reboot
#227
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request is neither linked to an issue or epic nor labeled as adhoc!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One note about the reboot behavior
const actorId = this.config.get('actorId')!; | ||
await this.metamorph(actorId); | ||
const runId = this.config.get('actorRunId')!; | ||
await this.apifyClient.run(runId).reboot(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should sleep here after the API call, like we do with metamorph, so that the Actor waits for the reboot to happen (otherwise it could finish before the reboot happens).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right, missed that, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request is neither linked to an issue or epic nor labeled as adhoc!
@@ -441,22 +441,26 @@ export class Actor<Data extends Dictionary = Dictionary> { | |||
* | |||
* @ignore | |||
*/ | |||
async reboot(): Promise<void> { | |||
async reboot(options: RebootOptions = {}): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls can we describe the use case of reboot() in jsdoc here? E.g. if the actor gets into irrecoverable error state, it can just reboot itself and continue work where it left off.
Closes #220