Persistent Job Queue & Maintenance Worker for backend
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- docker, go
- Ambito
- backend, databases, documentation
Direzione di ricerca
Inizia individuando il Go JobStore e l’entry point NewJobQueue, quindi esamina come il backend utilizza il volume Docker in /app/data e le variabili d’ambiente in .env. Definisci la persistenza per i job in attesa, in corso, completati e falliti, la pulizia pianificata e il ripristino dopo l’avvio; aggiorna il Backend README con il comportamento del database, di cron e delle variabili d’ambiente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
-
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.
-
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.
-
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
- Lingua principale
- TypeScript
- Stelle
- 37
- Fork
- 76
- Merge medio
- 3g 7h
- PR unite (30g)
- 2
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CCExtractor/ccsync
-
GET /tasks is not serialized and Taskwarrior data isolation may race through shared /root/.task Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
CCExtractor/ccsync#471 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
CCExtractor/ccsync#440 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
CCExtractor/ccsync#433 · 2 commenti ·
-
enhancement frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
CCExtractor/ccsync#425 ·
-
frontend good first issue help wanted test
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
CCExtractor/ccsync#300 · 14 commenti ·
Tutte le issue di CCExtractor/ccsync
Issue simili
-
blocklist removal
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
pastelsky/bundlephobia#1122 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100