mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-12 22:25:44 -04:00

Some checks failed
Run linters / lint (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Build Debian package / build (push) Has been cancelled
Build Docker image / buildx (push) Has been cancelled
Deploy static content to Pages / deploy (push) Has been cancelled
Build Homebrew package / build (push) Has been cancelled
Build GitHub Pages website / build (push) Has been cancelled
Build Pip package / build (push) Has been cancelled
Run tests / python_tests (ubuntu-22.04, 3.11) (push) Has been cancelled
Run tests / docker_tests (push) Has been cancelled
Build GitHub Pages website / deploy (push) Has been cancelled
23 lines
695 B
Python
23 lines
695 B
Python
__package__ = 'archivebox.crawls'
|
|
|
|
from typing import ClassVar
|
|
|
|
from crawls.models import Crawl
|
|
from crawls.statemachines import CrawlMachine
|
|
|
|
from actors.actor import ActorType, State
|
|
|
|
|
|
class CrawlActor(ActorType[Crawl]):
|
|
"""The Actor that manages the lifecycle of all Crawl objects"""
|
|
|
|
Model = Crawl
|
|
StateMachineClass = CrawlMachine
|
|
|
|
ACTIVE_STATE: ClassVar[State] = CrawlMachine.started
|
|
FINAL_STATES: ClassVar[list[State]] = CrawlMachine.final_states
|
|
STATE_FIELD_NAME: ClassVar[str] = Crawl.state_field_name
|
|
|
|
MAX_CONCURRENT_ACTORS: ClassVar[int] = 1
|
|
MAX_TICK_TIME: ClassVar[int] = 10
|
|
CLAIM_FROM_TOP_N: ClassVar[int] = MAX_CONCURRENT_ACTORS * 10
|