Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-advanced-user-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
caosdb
Software
caosdb-advanced-user-tools
Commits
c8456459
Commit
c8456459
authored
2 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
ENH: indicate if updates are incomplete
parent
c42a1bfc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!59
FIX: if multiple updates for one entity exist, the retrieve would result in an...
,
!56
F insert auth
Pipeline
#28068
failed
2 years ago
Stage: setup
Stage: cert
Stage: style
Stage: unittest
Stage: integrationtest
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosadvancedtools/crawler.py
+13
-0
13 additions, 0 deletions
src/caosadvancedtools/crawler.py
with
13 additions
and
0 deletions
src/caosadvancedtools/crawler.py
+
13
−
0
View file @
c8456459
...
...
@@ -225,6 +225,17 @@ class Crawler(object):
for
_
,
_
,
old
,
new
,
_
in
changes
:
new_cont
=
db
.
Container
()
new_cont
=
new_cont
.
from_xml
(
new
)
ids
=
[]
tmp
=
[]
update_incomplete
=
False
# remove duplicate entities
for
el
in
new_cont
:
if
el
.
id
not
in
ids
:
ids
.
append
(
el
.
id
)
tmp
.
append
(
el
)
else
:
update_incomplete
=
True
new_cont
=
tmp
if
new
[
0
].
version
:
valids
=
db
.
Container
()
nonvalids
=
db
.
Container
()
...
...
@@ -234,6 +245,7 @@ class Crawler(object):
if
ent
.
version
==
remote_ent
.
version
:
valids
.
append
(
remote_ent
)
else
:
update_incomplete
=
True
nonvalids
.
append
(
remote_ent
)
valids
.
update
(
unique
=
False
)
logger
.
info
(
"
Successfully updated {} records!
"
.
format
(
...
...
@@ -258,6 +270,7 @@ class Crawler(object):
logger
.
info
(
"
Successfully updated {} records!
"
.
format
(
len
(
new_cont
)))
all_updates
+=
len
(
new_cont
)
logger
.
info
(
"
Some updates could not be applied. Crawler has to rerun.
"
)
logger
.
info
(
"
Finished with authorized updates.
"
)
return
all_inserts
,
all_updates
...
...
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