Skip to content

Provide forceCloud to sessionPool #752

@pocesar

Description

@pocesar

Since session pool uses the KV underneath, it would be nice to pass the { forceCloud: true } like you can do with Apify.openKeyValueStore(). executing it locally should be able to fill the session file provided by persistStateKeyValueStoreId

EDIT: not a bug, but Github added the label automatically

hacky workaround:

    if (forceCloud === true && !Apify.isAtHome()) {
        if (sessionConfig.storageName) {
            delete process.env[ENV_VARS.LOCAL_STORAGE_DIR];
            process.env[ENV_VARS.DEFAULT_KEY_VALUE_STORE_ID] =
                sessionConfig.storageName;
        } else {
            log.warning("To use forceCloud, you need to provide a storageName");
        }
    }

Metadata

Metadata

Assignees

Labels

featureIssues that represent new features or improvements to existing features.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions