Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
snippets
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Platform
Development
snippets
Commits
a546af39
Unverified
Commit
a546af39
authored
7 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
morane/crossminer_launch: Fix origin_scan function to use range
+ add docstring
parent
7fbe9a1d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
morane/crossminer_launch.py
+11
-4
11 additions, 4 deletions
morane/crossminer_launch.py
with
11 additions
and
4 deletions
morane/crossminer_launch.py
+
11
−
4
View file @
a546af39
...
...
@@ -37,16 +37,22 @@ class DB_connection:
def
origin_scan
(
min_batch
,
max_batch
,
file_name
):
"""
Retrieve origins between range [min_batch, max_batch[ whose last
visit resulted in a directory holding a filename matching the pattern
`filename`.
"""
limit
=
max_batch
-
min_batch
return
"""
WITH last_visited AS (
SELECT o.url url, ov.snapshot_id snp, date
FROM origin o
INNER JOIN origin_visit ov on o.id = ov.origin
WHERE
0
<= o.id AND
o.id <
1000
AND
WHERE
%s
<= o.id AND
o.id <
%s
AND
ov.visit = (select max(visit) FROM origin_visit
where origin=o.id)
order by o.id limit
10000
;
order by o.id limit
%s
;
), head_branch_revision AS (
SELECT lv.url url, s.id snp_sha1, sb.target revision_sha1,
lv.date date
...
...
@@ -61,7 +67,8 @@ def origin_scan(min_batch, max_batch, file_name):
INNER JOIN revision rev on hbr.revision_sha1 = rev.id
INNER JOIN directory dir on rev.directory = dir.id
INNER JOIN directory_entry_file def on def.id = any(dir.file_entries)
WHERE def.name=
'
%s
'"""
%
(
min_batch
,
max_batch
,
file_name
)
WHERE def.name=
'
%s
'"""
%
(
min_batch
,
max_batch
,
limit
,
file_name
)
def
main
():
db
=
DB_connection
()
...
...
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