Skip to content
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

worker's architechture refactor #17

Open
7 tasks
tuana9a opened this issue Feb 13, 2024 · 0 comments
Open
7 tasks

worker's architechture refactor #17

tuana9a opened this issue Feb 13, 2024 · 0 comments

Comments

@tuana9a
Copy link
Owner

tuana9a commented Feb 13, 2024

Vấn đề

Hiện tại worker trao đổi với api-gateway thông qua message queue, điều này có những vấn đề như sau

  • hiện tại code handle rabbitmq đang không ổn định: khi rabbitmq chết thì worker không tự dộng reconnect được
  • khả năng mở rộng kém: ví dụ nếu người dùng muốn chạy (self-hosted) worker thì gần như là không thể triển khai được

Ý tưởng

  • Bỏ message queue: Worker giao tiếp trực tiếp với api-gateway bằng http
    • Lấy job cứ sau một khoảng thời gian 5s
    • Cập nhật trạng thái job sau mỗi bước
    • Gửi kết quả cuối cùng
      • Cơ chế retry, write ahead log
    • gửi heart beat mỗi 5s
  • thêm biến môi trường WORKER_TOKEN: được generate lúc đăng ký trên giao diện, cái này chỉ hiển thị một lần

Liên quan

child issue of #4

api quản lý worker #10

@tuana9a tuana9a transferred this issue from another repository Apr 14, 2024
@tuana9a tuana9a changed the title SoftwareAccount, API KEY for dkhptd-worker worker's architechture refactor Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

1 participant