Skip to content

Comments

Improve concurrency handling and async processing in DefenderWorker#50

Open
Killer-oooo wants to merge 1 commit into0xE232FE:20240626_developfrom
Killer-oooo:defenderworker-fix
Open

Improve concurrency handling and async processing in DefenderWorker#50
Killer-oooo wants to merge 1 commit into0xE232FE:20240626_developfrom
Killer-oooo:defenderworker-fix

Conversation

@Killer-oooo
Copy link

This PR refactors DefenderWorker to improve concurrency safety and async handling.

Changes:

  • Introduced ConcurrentDictionary to prevent duplicate attack processing
  • Added TTL-based tracking for handled attacks
  • Replaced Task.Factory.StartNew with Task.Run
  • Updated attack handling to use proper async/await flow
  • Cleaned up obsolete comments and streamlined logic

Impact:

  • Prevents duplicate or parallel processing of the same attack
  • Improves thread safety
  • Ensures controlled and sequential attack handling
  • Modernizes async usage to current best practices

No other components were modified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant