Skip to content
Snippets Groups Projects
Commit 5a10c6f5 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Minor improvements in ORM framework.

parent ef3d2182
No related branches found
No related tags found
1 merge request!54Release 2.0.0
......@@ -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)
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment