Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
TFS
controller
Commits
5a10c6f5
"...context/service/grpc_server/ContextServiceServicerImpl.py" did not exist on "79167bfdcff47faf72a86eca2bfe496c106b4982"
Commit
5a10c6f5
authored
3 years ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Minor improvements in ORM framework.
parent
ef3d2182
No related branches found
No related tags found
1 merge request
!54
Release 2.0.0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/orm/Factory.py
+2
-2
2 additions, 2 deletions
src/common/orm/Factory.py
src/common/orm/backend/inmemory/InMemoryBackend.py
+3
-3
3 additions, 3 deletions
src/common/orm/backend/inmemory/InMemoryBackend.py
with
5 additions
and
5 deletions
src/common/orm/Factory.py
+
2
−
2
View file @
5a10c6f5
...
...
@@ -27,6 +27,6 @@ def get_database_backend(backend : Optional[Union[str, BackendEnum]] = None, **s
if
backend
is
None
:
raise
Exception
(
'
Database Backend not specified
'
)
if
isinstance
(
backend
,
BackendEnum
):
backend
=
backend
.
value
backend_class
=
BACKENDS
.
get
(
backend
)
if
backend_class
is
None
:
raise
Exception
(
'
Unsupported DatabaseBackend({})
'
.
format
(
backend
))
LOGGER
.
info
(
'
Selected Database Backend: {}
'
.
format
(
backend
))
if
backend_class
is
None
:
raise
Exception
(
'
Unsupported DatabaseBackend({
:s
})
'
.
format
(
backend
))
LOGGER
.
info
(
'
Selected Database Backend: {
:s
}
'
.
format
(
backend
))
return
backend_class
(
**
settings
)
This diff is collapsed.
Click to expand it.
src/common/orm/backend/inmemory/InMemoryBackend.py
+
3
−
3
View file @
5a10c6f5
...
...
@@ -28,9 +28,9 @@ class InMemoryBackend(_Backend):
for
str_key
in
str_keys
:
if
(
str_key
in
self
.
_keys
)
and
(
len
(
self
.
_keys
[
str_key
])
>
0
)
and
(
self
.
_keys
[
str_key
]
!=
owner_key
):
# lock already acquired, cannot acquire all locks atomically
for
str_key
in
acquired_lock_keys
.
keys
()
:
if
str_key
not
in
self
.
_keys
:
continue
del
self
.
_keys
[
str_key
]
for
str_key
_acquired
in
acquired_lock_keys
:
if
str_key
_acquired
not
in
self
.
_keys
:
continue
del
self
.
_keys
[
str_key
_acquired
]
return
False
,
None
# lock available, temporarily acquire it; locks will be released if some of them for a requested
...
...
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