instedd / surveda

InSTEDD Surveda
https://instedd.org/technologies/surveda-mobile-surveys/
GNU General Public License v3.0
17 stars 6 forks source link

ChannelBroker: simplify & optimize the active calls collector #2302

Open ysbaddaden opened 1 year ago

ysbaddaden commented 1 year ago

The ChannelBrokerState.clean_inactive_respondents/1 function is meant to cleanup the inactive respondents, yet it takes a list of active respondents and the :collect_garbage handler of the channel-broker load all active respondents, and we must always load all of them (e.g. we can't paginate).

The logic should be reversed. Loading only the list of inactive respondents would load less respondent ids and allow to do the cleanups in batches.

See https://github.com/instedd/surveda/pull/2297#discussion_r1315162910