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

in-memory database: refactor needed #424

Open
mdonadoni opened this issue Jan 23, 2024 · 0 comments
Open

in-memory database: refactor needed #424

mdonadoni opened this issue Jan 23, 2024 · 0 comments

Comments

@mdonadoni
Copy link
Member

mdonadoni commented Jan 23, 2024

Job controller is keeping an "in-memory" copy of the Job table of the database.

First of all, we should investigate why this is needed, maybe for performance reason?

If it's not needed, should we drop the in-memory database and only use PostgreSQL?

If the in-memory database needs to be kept around, then:

  • use a proper class and not a dict
  • all the access to the in-memory database are done through methods of the class, no direct access to the job objects
  • use primitives (locks, condition variables, ...) to make sure the database is thread-safe
  • the class keeps the in-memory and the PostgreSQL database in sync
  • make the Job object a proper class and not a dict
  • if possible, avoid keeping the database as a global variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant