Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.57 KB

File metadata and controls

34 lines (21 loc) · 1.57 KB
id actor-configuration
title Actor configuration

import CodeBlock from '@theme/CodeBlock';

import ConfigExample from '!!raw-loader!./code/11_config.py';

The Actor class gets configured using the Configuration class, which initializes itself based on the provided environment variables.

If you're using the Apify SDK in your Actors on the Apify platform, or Actors running locally through the Apify CLI, you don't need to configure the Actor class manually,unless you have some specific requirements, everything will get configured automatically.

If you need some special configuration, you can adjust it either through the Configuration class directly,or by setting environment variables when running the Actor locally.

To see the full list of configuration options, check the Configuration class or the list of environment variables that the Actor understands.

Configuring from code

This will cause the Actor to persist its state every 10 seconds:

{ConfigExample}

Configuring via environment variables

All the configuration options can be set via environment variables. The environment variables are prefixed with APIFY_, and the configuration options are in uppercase, with underscores as separators. See the Configuration API reference for the full list of configuration options.

This Actor run will not persist its local storages to the filesystem:

APIFY_PERSIST_STORAGE=0 apify run