New Postgres storage

This commit is contained in:
2020-01-22 20:46:18 +01:00
parent 746fa0134f
commit 3bef45c9db
85 changed files with 10814 additions and 9262 deletions

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2019 Team tiramisu (see AUTHORS for all contributors)
# Copyright (C) 2014-2020 Team tiramisu (see AUTHORS for all contributors)
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
@ -109,10 +109,10 @@ class CacheOptionDescription(BaseOption):
config_bag: ConfigBag) -> None:
if 'force_store_value' not in config_bag.properties:
return
commit = False
values = config_bag.context.cfgimpl_get_values()
for subpath, option in self._cache_force_store_values:
if not await values._p_.hasvalue(subpath):
if not await values._p_.hasvalue(config_bag.connection,
subpath):
if option.impl_is_follower():
option_bag = OptionBag()
leader = option.impl_get_leadership().get_leader()
@ -127,7 +127,8 @@ class CacheOptionDescription(BaseOption):
index,
config_bag)
option_bag.properties = frozenset()
await values._p_.setvalue(subpath,
await values._p_.setvalue(config_bag.connection,
subpath,
await values.getvalue(option_bag),
owners.forced,
index,
@ -138,15 +139,12 @@ class CacheOptionDescription(BaseOption):
None,
config_bag)
option_bag.properties = frozenset()
await values._p_.setvalue(subpath,
await values._p_.setvalue(config_bag.connection,
subpath,
await values.getvalue(option_bag),
owners.forced,
None,
False)
commit = True
if commit:
await values._p_.commit()
class OptionDescriptionWalk(CacheOptionDescription):