Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
ff12d56c
Commit
ff12d56c
authored
10 years ago
by
Kevin S. Hahn
Browse files
Options
Downloads
Patches
Plain Diff
only create jobs if dataset is parseable
parent
063ee2fe
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
util.py
+3
-1
3 additions, 1 deletion
util.py
with
3 additions
and
1 deletion
util.py
+
3
−
1
View file @
ff12d56c
...
...
@@ -20,6 +20,7 @@ def insert_file(dbc, _id, file_info, filepath, digest, data_path, quarantine_pat
"""
Insert a file as an attachment or as a file.
"""
filename
=
os
.
path
.
basename
(
filepath
)
flavor
+=
'
s
'
dataset
=
None
if
_id
is
None
:
try
:
log
.
info
(
'
Parsing %s
'
%
filename
)
...
...
@@ -68,7 +69,8 @@ def insert_file(dbc, _id, file_info, filepath, digest, data_path, quarantine_pat
if
not
success
[
'
updatedExisting
'
]:
dbc
.
update
({
'
_id
'
:
_id
},
{
'
$push
'
:
{
flavor
:
file_info
}})
shutil
.
move
(
filepath
,
container_path
+
'
/
'
+
filename
)
create_job
(
dbc
,
dataset
)
if
dataset
:
# only create jobs if dataset is parseable
create_job
(
dbc
,
dataset
)
log
.
debug
(
'
Done %s
'
%
os
.
path
.
basename
(
filepath
))
# must use filepath, since filename is updated for sorted files
return
200
,
'
Success
'
...
...
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