[OpenSIPS-Users] OpenSIPS 3.1 - Test if cache is empty?

Liviu Chircu liviu at opensips.org
Wed Nov 25 14:26:30 EST 2020


On 25.11.2020 16:18, Mark Allen wrote:
> If the DB table is updated I can flush the cache of the old data with 
> "opensips-cli -x mi cache_remove_chunk". I would then want to have a 
> test in OpenSIPS that says that if the cache is empty, re-populate it 
> from the DB. Is this possible?

Hi, Mark!

 From my knowledge, the "cachedb is empty" test is not available right now.

However, why not use either the recently added "raise_event" [1] 
function, or even a shared $shv(cache_reset) variable [2] as a pure 
"on/off" binary marker in order to hook into the opensips.cfg 
environment via MI interface and then instruct OpenSIPS to do a 
cache_remove_chunk() [3], followed by re-populating the cache?

[1]: https://www.opensips.org/Documentation/Interface-CoreMI-3-2#toc20
[2]: https://opensips.org/docs/modules/3.2.x/cfgutils.html#idp337920
[3]: 
https://opensips.org/docs/modules/3.2.x/cachedb_local.html#func_cache_remove_chunk

Best regards,

-- 
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com




More information about the Users mailing list