Skip to content
Snippets Groups Projects
Commit e337e539 authored by Alexis Kalderimis's avatar Alexis Kalderimis 💬 Committed by Andy Soiron
Browse files

Improve web-hook failure state cache

This makes the following changes:

- uses the Redis shared state rather than the rails cache, to allow
  touching the cache from more places safely
- intelligently sets the cached value of any-hook-failed when a hook
  succeeds or fails. If it succeeds, then if the state was previously
  failing, we query sibling hooks to possibly clear it. If it is now
  failing, we don't have to do that query, and can safely mark it as
  failed.

Why do we do this?

- These changes ensure that if a hook fails, the cache is invalidated
  immediately, and if a hook succeeds, the staet is is cleared so that
  users do not see irrelevant notifications
- Additionally, this reduces the time between a hook failing and any
  notiication being shown to users.
parent 3dc7659c
No related branches found
No related tags found
No related merge requests found
Loading
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