-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ignore hook when disable #702
Conversation
WalkthroughA conditional check has been added to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TriggerHookWorker
participant Config
User ->> TriggerHookWorker: subscribe()
TriggerHookWorker ->> Config: this.config.cnpmcore.hookEnable
alt hookEnable is true
TriggerHookWorker ->> TriggerHookWorker: Proceed with subscription logic
else hookEnable is false
TriggerHookWorker ->> TriggerHookWorker: Skip subscription logic
end
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #702 +/- ##
==========================================
- Coverage 96.81% 96.81% -0.01%
==========================================
Files 181 181
Lines 18002 18003 +1
Branches 2337 2338 +1
==========================================
Hits 17429 17429
- Misses 573 574 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- app/port/schedule/TriggerHookWorker.ts (1 hunks)
Additional comments not posted (1)
app/port/schedule/TriggerHookWorker.ts (1)
30-30
: LGTM! Ensure configuration is used correctly across the codebase.The added conditional check to verify
this.config.cnpmcore.hookEnable
is a necessary improvement to prevent redundant Redis queries whenhookEnable
is disabled.However, verify that this configuration (
hookEnable
) is correctly set and used across the codebase.Verification successful
Configuration usage verified successfully.
The
hookEnable
configuration is correctly set and consistently used across the codebase. The configuration is defined inconfig/config.default.ts
and utilized in multiple files, including tests, ensuring its functionality is well-covered.
config/config.default.ts
:hookEnable
is set tofalse
.app/port/config.ts
:hookEnable
is defined as a boolean.app/port/schedule/TriggerHookWorker.ts
: The new conditional check usinghookEnable
.app/port/schedule/CreateTriggerHookWorker.ts
: UseshookEnable
.app/core/event/ChangesStream.ts
: Multiple checks forhookEnable
.test/core/event/ChangesStream.test.ts
: Tests forhookEnable
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `hookEnable` configuration across the codebase. # Test: Search for the configuration usage. Expect: Consistent usage of `hookEnable`. rg --type typescript 'hookEnable'Length of output: 68
Script:
#!/bin/bash # Description: Verify the usage of `hookEnable` configuration across the codebase. # Test: Search for the configuration usage. Expect: Consistent usage of `hookEnable`. rg --type ts 'hookEnable'Length of output: 1146
[skip ci] ## [3.61.6](v3.61.5...v3.61.6) (2024-07-11) ### Bug Fixes * ignore hook when disable ([#702](#702)) ([bd49917](bd49917))
CreateTriggerHookWorker
, when hookEnable is not activated, do not query task queue.CreateTriggerHookWorker
逻辑,hookEnable 关闭时,不进行存量任务轮训Summary by CodeRabbit