l.s.d.p.LaunchpadDatabasePolicy(BaseDatabasePolicy) : class documentation

Part of lp.services.database.policy View In Hierarchy

Default database policy for web requests.

Selects the DEFAULT_FLAVOR based on the request.

Method __init__ Undocumented
Method install See IDatabasePolicy.
Method uninstall See IDatabasePolicy.
Method getReplicationLag Return the replication lag between the primary and our hot standby.
Method _hasSession Is there is already a session cookie hanging around?

Inherited from BaseDatabasePolicy:

Method getStore See IDatabasePolicy.
Method __enter__ See IDatabasePolicy.
Method __exit__ See IDatabasePolicy.
def __init__(self, request):
Undocumented
def _hasSession(self):
Is there is already a session cookie hanging around?
def install(self):
See IDatabasePolicy.
def uninstall(self):
See IDatabasePolicy.

If the request just handled was not read_only, we need to store this fact and the timestamp in the session. Subsequent requests can then keep using the master until they are sure any changes made have been propagated.

def getReplicationLag(self):
Return the replication lag between the primary and our hot standby.
Returnstimedelta, or None if this isn't a replicated environment,
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.