cubicweb/hooks/test/data/hooks.py
author Philippe Pepiot <ph@itsalwaysdns.eu>
Mon, 30 Mar 2020 15:30:02 +0200
changeset 12961 01810941a4be
parent 12355 c703dc95c82e
permissions -rw-r--r--
[server] use a LifoQueue in _CnxSetPool In postgresql, some cache is attached to the connection. Using a LifoQueue (last-in, first-out) makes a few connections to get the most load which give best performance.

from cubicweb.predicates import is_instance
from cubicweb.hooks import notification


class FolderUpdateHook(notification.EntityUpdateHook):
    __select__ = (notification.EntityUpdateHook.__select__
                  & is_instance('Folder'))
    order = 100  # late trigger so that metadata hooks come before.