Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123175
D1242.id3922.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D1242.id3922.diff
View Options
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -18,7 +18,21 @@
url: http://localhost:5002/
```
-## API
+## Celery
+
+Load tarball using celery.
+
+Providing you have a properly configured celery up and running, the
+celery worker configuration file needs to be updated:
+
+*`{/etc/softwareheritage | ~/.config/swh | ~/.swh}`/worker.yml*:
+
+``` YAML
+task_modules:
+ - swh.loader.tar.tasks
+task_queues:
+ - swh_loader_tar
+```
### local
@@ -34,15 +48,14 @@
import logging
logging.basicConfig(level=logging.DEBUG)
-from swh.loader.tar.tasks import LoadTarRepository
-l = LoadTarRepository()
-l.run_task(origin=origin, visit_date=visit_date,
- last_modified=last_modified)
+from swh.loader.tar.tasks import load_tar
+load_tar(origin=origin, visit_date=visit_date,
+ last_modified=last_modified)
```
### remote
-Load remote tarball is the same sample
+Load remote tarball is the same sample:
```Python
url = 'https://ftp.gnu.org/gnu/8sync/8sync-0.1.0.tar.gz'
@@ -52,8 +65,7 @@
import logging
logging.basicConfig(level=logging.DEBUG)
-from swh.loader.tar.tasks import LoadTarRepository
-l = LoadTarRepository()
-l.run_task(origin=origin, visit_date=visit_date,
- last_modified=last_modified)
+from swh.loader.tar.tasks import load_tar
+load_tar(origin=origin, visit_date=visit_date,
+ last_modified=last_modified)
```
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 18, 1:36 AM (2 d, 5 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3220049
Attached To
D1242: README: update loading instructions (now using celery task)
Event Timeline
Log In to Comment