Ticket #259 (closed enhancement: fixed)
synchronization of data between modules and gscf
|Reported by:||robert@…||Owned by:||robert@…|
GSCF contains data about studies, assays and samples, and connections between them. However, the modules also need to know some information about it, at least which samples belong to which assay.
Synchronization is now done by fetching all data from gscf, and saving necessary information locally (by the module). But the module has to do it every request, in order to provide the user with up-to-date information. Also, all studies have to be fetched, since the module doesn't know which study or assay has changed.
This takes a lot of REST calls, and could be improved. If GSCF would notice the modules of changes in studies or assays, the module wouldn't have to do so much rest calls.
It could be done like this:
GSCF calls module/rest/invalidate?studyToken=ABC when study ABC is changed (asynchronously, so GSCF can continue working; in study.save() and study.delete() methods). GSCF could call this method on every module, or gscf could keep track of modules that implement this method. The module now knows that the study should be synchronized.
The module can decide to synchronize immediately or wait until the given study is asked asked for (e.g. by marking the study as dirty). This also works for new and deleted studies: when the module synchronizes, it will notice whether a study is new, changed or deleted.