-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
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
Jobobject a proper class and not a dict - if possible, avoid keeping the database as a global variable