Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Persistent Job Queue & Maintenance Worker for backend

Đang mở
#367 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
docker, go

Hướng nghiên cứu

Bắt đầu bằng cách xác định Go JobStore và entry point NewJobQueue, sau đó xem xét cách backend sử dụng Docker volume tại /app/data và các biến môi trường trong .env. Xác định cơ chế persistence cho các job đang chờ, đang xử lý, đã hoàn thành và thất bại, cơ chế cleanup theo lịch và việc recovery sau khi khởi động; cập nhật Backend README với cách hoạt động của database, cron và các biến môi trường.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

backend complex enhancement

Is your feature request related to a problem? Please describe.
The current job queue is volatile. If the backend container crashes or restarts, all queued tasks are lost forever. This needs to be persistent, so that occasional backend downtimes do not affect the Jobs. Additionally, as we implement persistence, we need a way to manage the lifecycle of the "Success" and "Failure" logs stored in the database to prevent unbounded disk usage.

Describe the solution you'd like

  1. Implement a disk-backed queue using bbolt (or something similar, open to suggestions) and an internal Go-based cron scheduler for maintenance.

    • The Queue will work as a database that will store all Jobs from the JobStore.
  2. Persistence Layer (bbolt)

    • Store the database file at /app/data/queue.db to use the existing Docker volume.
    • Job States: Implement buckets or tables for Pending, In-Progress (doubt if it should exist, perhaps Pending, Completed, and Failed should suffice for our use case), and Completed statuses.
    • Reliability: On startup, a NewJobQueue function must scan the Pending and In-Progress buckets and re-insert those jobs into the channel. Upon completion, mark them as completed.
  3. Scheduled Maintenance (Cron)

    • Integrate a package like robfig/cron/v3 to handle periodic tasks without external dependencies.
    • Cleanup Job: Runs every 24 hours (or at midnight). Add that CRON parameter as an optional variable in .env file. Users might want to customise, but having a default value is nice, as well.
    • Logic: Deletes all entries from the Completed or Failed buckets that are older than 7 days.

Additional context
Need to take into account the amount of storage that database will cost. And hence optimise it further. Documentation, related to the changes, related to env vars, and cron job along with the Database need to be added, to the Backend README. The current functionality should not be affected/broken.

  • The issue is open to all for their versions of implementations.

Links:
https://github.com/etcd-io/bbolt
https://github.com/robfig/cron

Ngôn ngữ chính
TypeScript
Star
37
Fork
76
Merge trung bình
3 ngày 7 giờ
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CCExtractor/ccsync

Tất cả issue của CCExtractor/ccsync

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.