Skip to content

Modify periodic loop timing and add batch threshold flush#35

Open
Hans37675042 wants to merge 1 commit into
csp0924:mainfrom
Hans37675042:improve_lib
Open

Modify periodic loop timing and add batch threshold flush#35
Hans37675042 wants to merge 1 commit into
csp0924:mainfrom
Hans37675042:improve_lib

Conversation

@Hans37675042

Copy link
Copy Markdown

Summary

  • Modify(equipment): rewrite read loop interval using time.monotonic() + ceil() to prevent execution time drift
  • Modify(mongo): rewrite read loop interval using time.monotonic() + ceil() to prevent execution time drift
  • Fix(mongo): trigger immediate flush via _flush_event when batch size reaches threshold, instead of waiting for next periodic cycle
  • Chore: add .obsidian/ to .gitignore

Changed Files

  • csp_lib/equipment/device/base.py — rewrite interval calculation
  • csp_lib/mongo/uploader.py — flush loop rewrite + add _flush_event mechanism
  • tests/mongo/test_uploader.py — add uploader related tests
  • .gitignore — add .obsidian/

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