fastapi-users

This commit is contained in:
msramalho
2023-02-23 18:54:19 +01:00
parent c6b39db295
commit 75e98f5f31
13 changed files with 634 additions and 35 deletions

View File

@@ -10,7 +10,6 @@ celery = Celery(__name__)
celery.conf.broker_url = os.environ.get("CELERY_BROKER_URL", "redis://localhost:6379")
celery.conf.result_backend = os.environ.get("CELERY_RESULT_BACKEND", "redis://localhost:6379")
@celery.task(name="create_task")
def create_task(task_type):
print("DEV MODE")
@@ -25,8 +24,8 @@ config.parse(use_cli=False, yaml_config_filename="orchestration.yaml")
orchestrator = None
@celery.task(name="create_archive_task")
def create_archive_task(url: str = ""):
def create_archive_task(url: str , user_email:str=""):
global orchestrator
if not orchestrator: orchestrator = ArchivingOrchestrator(config)
return orchestrator.feed_item(Metadata().set_url(url)).to_json()
return True
#TODO: associate user with url (?)