Skip to content

Conversation

adenchen123
Copy link
Contributor

@adenchen123 adenchen123 commented Oct 15, 2025

PR Type

Enhancement


Description

  • Moved delay inside distributed lock to prevent race conditions

  • Changed delay timing from before lock to after cron checker execution


Diagram Walkthrough

flowchart LR
  A["Acquire Lock"] --> B["Run Cron Checker"]
  B --> C["Delay 1 Second"]
  C --> D["Release Lock"]
Loading

File Walkthrough

Relevant files
Enhancement
CrontabWatcher.cs
Relocate delay inside distributed lock callback                   

src/Infrastructure/BotSharp.Core.Crontab/Services/CrontabWatcher.cs

  • Moved Task.Delay(1000) from outside to inside the LockAsync callback
  • Delay now occurs after RunCronChecker execution instead of before lock
    acquisition
  • Ensures delay happens within the distributed lock scope
+1/-4     

Copy link

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
- [ ] Create ticket/issue <!-- /create_ticket --create_ticket=true -->

</details></td></tr>
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

Copy link

PR Code Suggestions ✨

No code suggestions found for the PR.

@yileicn
Copy link
Collaborator

yileicn commented Oct 15, 2025

reviewed

@yileicn yileicn merged commit c09214f into SciSharp:master Oct 16, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants