Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/apify/src/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,9 @@ export class Actor<Data extends Dictionary = Dictionary> {
options.exit ??= true;
options.exitCode ??= EXIT_CODES.SUCCESS;
options.timeoutSecs ??= 30;

this._ensureActorInit('exit');

const client = this.config.getStorageClient();
const events = this.config.getEventManager();

Expand Down Expand Up @@ -807,6 +810,8 @@ export class Actor<Data extends Dictionary = Dictionary> {
* @ignore
*/
async reboot(options: RebootOptions = {}): Promise<void> {
this._ensureActorInit('reboot');

if (!this.isAtHome()) {
log.warning(
'Actor.reboot() is only supported when running on the Apify platform.',
Expand Down Expand Up @@ -916,6 +921,8 @@ export class Actor<Data extends Dictionary = Dictionary> {
ow(statusMessage, ow.string);
ow(isStatusMessageTerminal, ow.optional.boolean);

this._ensureActorInit('setStatusMessage');

const loggedStatusMessage = `[Status message]: ${statusMessage}`;

switch (level) {
Expand Down Expand Up @@ -1523,6 +1530,8 @@ export class Actor<Data extends Dictionary = Dictionary> {
defaultValue = {} as State,
options?: UseStateOptions,
) {
this._ensureActorInit('useState');

const kvStore = await KeyValueStore.open(options?.keyValueStoreName, {
config: options?.config || Configuration.getGlobalConfig(),
});
Expand Down
Loading