d582f15681
- Implemented tests for import polling functionality, ensuring correct behavior for active and terminal import statuses. - Created tests for the login page, validating user interactions and error handling. - Added unit tests for money utility functions, covering parsing, formatting, and summation of monetary values. - Developed tests for query keys, ensuring proper scoping and invalidation roots. chore: setup testing environment and configuration - Added setup file for testing with Vitest and Testing Library. - Configured TypeScript and Vite for the frontend project. - Created Docker and Nginx configurations for local development and production environments. - Established a PostgreSQL initialization script for setting up application roles. docs: add README and environment configuration for infra - Included README for the infra directory, detailing local development setup and service descriptions. - Created an example environment configuration file for local development with placeholders for sensitive information.
35 lines
925 B
Python
35 lines
925 B
Python
from celery import Celery
|
|
|
|
from app.config import get_settings
|
|
|
|
|
|
def create_celery_app() -> Celery:
|
|
settings = get_settings()
|
|
app = Celery(
|
|
"finance",
|
|
broker=settings.broker_url,
|
|
include=["app.imports.tasks", "app.exports.tasks"],
|
|
)
|
|
app.conf.update(
|
|
task_acks_late=True,
|
|
task_acks_on_failure_or_timeout=False,
|
|
worker_prefetch_multiplier=1,
|
|
worker_max_tasks_per_child=50,
|
|
worker_max_memory_per_child=250_000,
|
|
task_time_limit=600,
|
|
task_soft_time_limit=480,
|
|
task_always_eager=settings.celery_task_always_eager,
|
|
broker_connection_retry_on_startup=True,
|
|
task_default_queue="finance",
|
|
beat_schedule={
|
|
"purge-due-spaces-hourly": {
|
|
"task": "spaces.purge_due",
|
|
"schedule": 3600.0,
|
|
}
|
|
},
|
|
)
|
|
return app
|
|
|
|
|
|
celery_app = create_celery_app()
|