2021-11-29 10:23:47 +01:00
|
|
|
"""
|
|
|
|
|
Run this script from galaxy's root with
|
|
|
|
|
```
|
|
|
|
|
ipython -i scripts/celery_shell.py -- -c config/galaxy.yml
|
|
|
|
|
```
|
|
|
|
|
"""
|
2024-01-30 16:49:31 +00:00
|
|
|
|
2021-11-29 10:23:47 +01:00
|
|
|
import logging
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
WARNING_MODULES = ["parso", "asyncio", "galaxy.datatypes"]
|
|
|
|
|
for mod in WARNING_MODULES:
|
|
|
|
|
logger = logging.getLogger(mod)
|
|
|
|
|
logger.setLevel("WARNING")
|
|
|
|
|
|
|
|
|
|
from scripts.db_shell import config
|
2021-11-29 09:29:18 +01:00
|
|
|
|
|
|
|
|
os.environ["GALAXY_CONFIG_FILE"] = os.environ.get("GALAXY_CONFIG_FILE", config["config_file"])
|
2022-02-02 15:26:21 -05:00
|
|
|
|
2021-11-29 10:23:47 +01:00
|
|
|
from galaxy.celery import tasks # noqa: F401
|
|
|
|
|
from galaxy.celery import get_galaxy_app
|
2021-11-29 09:29:18 +01:00
|
|
|
|
2021-11-29 10:23:47 +01:00
|
|
|
HELP = """
|
|
|
|
|
============
|
|
|
|
|
Run celery tasks interactively.
|
|
|
|
|
tasks are collected in task module.
|
|
|
|
|
|
|
|
|
|
To run recalculate_user_disk_usage for user 1 in a celery worker
|
|
|
|
|
type
|
2022-03-29 13:45:41 +02:00
|
|
|
>>> tasks.recalculate_user_disk_usage.delay(user_id=1)
|
2021-11-29 10:23:47 +01:00
|
|
|
"""
|
2021-11-29 09:29:18 +01:00
|
|
|
|
|
|
|
|
app = get_galaxy_app()
|
2021-11-29 10:23:47 +01:00
|
|
|
print(HELP)
|