Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066221
D976.id3108.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1010 B
Subscribers
None
D976.id3108.diff
View Options
diff --git a/swh/loader/pypi/tasks.py b/swh/loader/pypi/tasks.py
--- a/swh/loader/pypi/tasks.py
+++ b/swh/loader/pypi/tasks.py
@@ -3,17 +3,13 @@
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
-from swh.scheduler.task import Task
+from celery import current_app as app
from .loader import PyPILoader
-class LoadPyPI(Task):
- task_queue = 'swh_loader_pypi'
-
- def run_task(self, project_name, project_url, project_metadata_url=None):
- loader = PyPILoader()
- loader.log = self.log
- return loader.load(project_name,
- project_url,
- project_metadata_url=project_metadata_url)
+@app.task(name=__name__ + '.LoadPyPI')
+def load_pypi(project_name, project_url, project_metadata_url=None):
+ return PyPILoader().load(project_name,
+ project_url,
+ project_metadata_url=project_metadata_url)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 5 2024, 1:32 AM (8 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3226282
Attached To
D976: Rewrite celery tasks as a decorated function
Event Timeline
Log In to Comment