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
b006c4b7
Commit
b006c4b7
authored
2 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: added doc and return value to authorize_changes"
parent
1d4221f2
Branches
Branches containing commit
Tags
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
#28059
passed
2 years ago
Stage: setup
Stage: cert
Stage: style
Stage: unittest
Stage: integrationtest
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/caosadvancedtools/cache.py
+2
-2
2 additions, 2 deletions
src/caosadvancedtools/cache.py
src/caosadvancedtools/crawler.py
+5
-0
5 additions, 0 deletions
src/caosadvancedtools/crawler.py
with
7 additions
and
2 deletions
src/caosadvancedtools/cache.py
+
2
−
2
View file @
b006c4b7
...
...
@@ -349,12 +349,12 @@ class UpdateCache(AbstractCache):
return
old_ones
def
insert
(
self
,
cont
,
run_id
,
insert
=
False
):
"""
Insert a pending, unauthorized insert
s
"""
Insert a pending, unauthorized insert
or update
Parameters
----------
cont: Container with the records to be inserted containing the desired
cont: Container with the records to be inserted
or updated
containing the desired
version, i.e. the state after the update.
run_id: int
...
...
This diff is collapsed.
Click to expand it.
src/caosadvancedtools/crawler.py
+
5
−
0
View file @
b006c4b7
...
...
@@ -210,11 +210,14 @@ class Crawler(object):
"""
cache
=
UpdateCache
()
inserts
=
cache
.
get_inserts
(
run_id
)
all_inserts
=
0
all_updates
=
0
for
_
,
_
,
_
,
new
,
_
in
inserts
:
new_cont
=
db
.
Container
()
new_cont
=
new_cont
.
from_xml
(
new
)
new_cont
.
insert
(
unique
=
False
)
logger
.
info
(
"
Successfully inserted {} records!
"
.
format
(
len
(
new_cont
)))
all_inserts
+=
len
(
new_cont
)
logger
.
info
(
"
Finished with authorized updates.
"
)
changes
=
cache
.
get_updates
(
run_id
)
...
...
@@ -238,7 +241,9 @@ class Crawler(object):
new_cont
.
update
(
unique
=
False
)
logger
.
info
(
"
Successfully updated {} records!
"
.
format
(
len
(
new_cont
)))
all_updates
+=
len
(
new_cont
)
logger
.
info
(
"
Finished with authorized updates.
"
)
return
all_inserts
,
all_updates
def
collect_cfoods
(
self
):
"""
...
...
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