The platform for continuously improving AI agents.
from celery import shared_task
from overbae.models import Project
from overbae.services import context_graph
@shared_task(acks_late=True, time_limit=180, soft_time_limit=170)
def refresh_project(project_id):
project = Project.objects.filter(pk=project_id, is_active=True).first()
if project:
context_graph.refresh(project)
@shared_task
def refresh_projects():
for identity in Project.objects.filter(is_active=True).values_list("pk", flat=True).iterator():
refresh_project.delay(str(identity))