Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-indexer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jérémy Bobbio (Lunar)
swh-indexer
Commits
9e2ce82e
Commit
9e2ce82e
authored
8 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Plain Diff
New upstream version 0.0.15
parents
b97a6495
56c18ede
No related branches found
Branches containing commit
Tags
debian/0.25.0-1_swh1
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
PKG-INFO
+1
-1
1 addition, 1 deletion
PKG-INFO
swh.indexer.egg-info/PKG-INFO
+1
-1
1 addition, 1 deletion
swh.indexer.egg-info/PKG-INFO
swh/indexer/producer.py
+20
-13
20 additions, 13 deletions
swh/indexer/producer.py
version.txt
+1
-1
1 addition, 1 deletion
version.txt
with
23 additions
and
16 deletions
PKG-INFO
+
1
−
1
View file @
9e2ce82e
Metadata-Version: 1.0
Name: swh.indexer
Version: 0.0.1
4
Version: 0.0.1
5
Summary: Software Heritage Content Indexer
Home-page: https://forge.softwareheritage.org/diffusion/78/
Author: Software Heritage developers
...
...
This diff is collapsed.
Click to expand it.
swh.indexer.egg-info/PKG-INFO
+
1
−
1
View file @
9e2ce82e
Metadata-Version: 1.0
Name: swh.indexer
Version: 0.0.1
4
Version: 0.0.1
5
Summary: Software Heritage Content Indexer
Home-page: https://forge.softwareheritage.org/diffusion/78/
Author: Software Heritage developers
...
...
This diff is collapsed.
Click to expand it.
swh/indexer/producer.py
+
20
−
13
View file @
9e2ce82e
...
...
@@ -10,12 +10,6 @@ import sys
from
swh.core
import
utils
,
hashutil
from
swh.scheduler.celery_backend.config
import
app
from
.
import
tasks
,
TASK_NAMES
# noqa
task_name
=
TASK_NAMES
[
'
orchestrator_all
'
]
orchestrator_task
=
app
.
tasks
[
task_name
]
def
read_from_stdin
():
for
sha1
in
sys
.
stdin
:
...
...
@@ -32,31 +26,44 @@ def gen_sha1(batch):
yield
sha1s
def
run_with_limit
(
limit
,
batch
):
def
run_with_limit
(
task
,
limit
,
batch
):
count
=
0
for
sha1s
in
gen_sha1
(
batch
):
count
+=
len
(
sha1s
)
print
(
'
%s sent - [%s, ...]
'
%
(
len
(
sha1s
),
sha1s
[
0
]))
orchestrator_
task
.
delay
(
sha1s
)
task
.
delay
(
sha1s
)
if
count
>=
limit
:
return
def
run_no_limit
(
batch
):
def
run_no_limit
(
task
,
batch
):
for
sha1s
in
gen_sha1
(
batch
):
print
(
'
%s sent - [%s, ...]
'
%
(
len
(
sha1s
),
sha1s
[
0
]))
orchestrator_
task
.
delay
(
sha1s
)
task
.
delay
(
sha1s
)
@click.command
(
help
=
'
Read sha1 from stdin and send them for indexing
'
)
@click.option
(
'
--limit
'
,
default
=
None
,
help
=
'
Limit the number of data to read
'
)
@click.option
(
'
--batch
'
,
default
=
'
10
'
,
help
=
'
Group data by batch
'
)
def
main
(
limit
,
batch
):
@click.option
(
'
--task-name
'
,
default
=
'
orchestrator_all
'
,
help
=
''
)
def
main
(
limit
,
batch
,
task_name
):
batch
=
int
(
batch
)
from
.
import
tasks
,
TASK_NAMES
# noqa
possible_tasks
=
TASK_NAMES
.
keys
()
if
task_name
not
in
possible_tasks
:
print
(
'
The task_name can only be one of %s
'
%
'
,
'
.
join
(
possible_tasks
))
return
task_name
=
TASK_NAMES
[
'
orchestrator_all
'
]
task
=
app
.
tasks
[
task_name
]
if
limit
:
run_with_limit
(
int
(
limit
),
batch
)
run_with_limit
(
task
,
int
(
limit
),
batch
)
else
:
run_no_limit
(
batch
)
run_no_limit
(
task
,
batch
)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
version.txt
+
1
−
1
View file @
9e2ce82e
v0.0.14-0-g2c192c5
\ No newline at end of file
v0.0.15-0-g56c18ed
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment