##// END OF EJS Templates
caches: use individual namespaces per user to prevent beaker caching problems....
caches: use individual namespaces per user to prevent beaker caching problems. - especially for mysql in case large number of data in caches there could be critical errors storing cache, and thus preventing users from authentication. This is caused by the fact that we used single namespace for ALL users. It means it grew as number of users grew reaching mysql single column limit. This changes the behaviour and now we use namespace per-user it means that each user-id will have it's own cache namespace fragmenting maximum column data to a single user cache. Which we should never reach.

File last commit:

r552:9a0f45b0 default
r2591:36829a17 stable
Show More
hooks.rst
86 lines | 3.1 KiB | text/x-rst | RstLexer

Hooks

Within |RCM| there are two types of supported hooks.

  • Internal built-in hooks: The internal |hg| or |git| hooks are triggered by different VCS operations, like push, pull, or clone and are non-configurable, but you can add your own VCS hooks, see :ref:`custom-hooks`.
  • User defined hooks: User defined hooks centre around the lifecycle of certain actions such are |repo| creation, user creation etc. The actions these hooks trigger can be rejected based on the API permissions of the user calling them.

Those custom hooks can be called using |RCT|, see :ref:`rc-tools`. To create a custom hook, see the :ref:`event-listener` section.

Making your Extension listen for Events

To create a hook to work with a plugin or extension, you need configure a listener in the :file:`/home/{user}/{instance-id}/rcextensions/__init__.py` file, and use the load_extension method.

Use the following example to create your extensions. In this example:

  • The hook is calling the ('my_post_push_extension.py') extension.
  • The hook is listening to |RCM| for pushes to |repos|.
  • This highlighted code is the hook, and configured in the __init__.py file.
  • It is inserted into the def _pushhook(*args, **kwargs) section, if it is not in the default __ini__.py file, use the below non-highlighted section to create it.

Once your plugin and hook are configured, restart your instance of |RCM| and your event listener will triggered as soon as a user pushes to a |repo|.