-
- Downloads
An error occurred while retrieving diff 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.
Showing
- app/helpers/web_hooks/web_hooks_helper.rb 1 addition, 9 deletionsapp/helpers/web_hooks/web_hooks_helper.rb
- app/models/concerns/web_hooks/has_web_hooks.rb 46 additions, 0 deletionsapp/models/concerns/web_hooks/has_web_hooks.rb
- app/models/hooks/project_hook.rb 10 additions, 6 deletionsapp/models/hooks/project_hook.rb
- app/models/project.rb 1 addition, 0 deletionsapp/models/project.rb
- spec/helpers/web_hooks/web_hooks_helper_spec.rb 5 additions, 13 deletionsspec/helpers/web_hooks/web_hooks_helper_spec.rb
- spec/models/hooks/project_hook_spec.rb 93 additions, 13 deletionsspec/models/hooks/project_hook_spec.rb
- spec/models/hooks/web_hook_spec.rb 1 addition, 1 deletionspec/models/hooks/web_hook_spec.rb
- spec/models/project_spec.rb 8 additions, 0 deletionsspec/models/project_spec.rb
- spec/support/shared_examples/models/concerns/web_hooks/has_web_hooks_shared_examples.rb 107 additions, 0 deletions...odels/concerns/web_hooks/has_web_hooks_shared_examples.rb
Loading
Please register or sign in to comment