Closed TANK2003 closed 1 year ago
This part of code is relevant only if you use the CACHE_CHECK_INTERVAL option for asynchronous cache invalidation.
In basic use case, the cache is always refreshed when the project is modified on disk or in database: cache is checked
on cache_lookup(..)
call.
Yes i have try to use CACHE_CHECK_INTERVAL, bu it is not working as expecting. When check the code, it is as if whenever the value of CACHE_CHECK_INTERVAL, the cache will never be refresh
If the check_interval congiguration value cls. _cache_check_interval <= 0 the cache will be never refresh ?
If check_interval congiguration value cls. _cache_check_interval <= 0
the cache will not refresh from this call but will refresh when performing cache lookup(...)
.
If check_interval congiguration value cls. _cache_check_interval > 0
the cache will potentially refresh asynchronously from this code but will not refresh when performing cache lookup(...)
.
if time() - cls._cache_last_check < cls._cache_check_interval the cache will be never refresh ?
check_interval congiguration value cls. _cache_check_interval > 0
the cache will refresh asynchronously only when time() - cls._cache_last_check >= cls._cache_check_interval the cache will be never refresh
.The purpose of CACHE_CHECK_INTERVAL
is to trigger refresh only at specified interval.
Of course, in all cases, projects are reloaded only if they have been modified.
Yes i have try to use CACHE_CHECK_INTERVAL, bu it is not working as expecting.
What was your expectation ?
Thanks for all the details explanaition !
What was your expectation ?
I thought that the variable CACHE_CHECK_INTERVAL represented the maximum time between the generation of the cache, but between two requests, not that it is even without requests on server ; That is very good!
But I just did some tests, this condition is never true state == UpdateState.UPDATED
(https://github.com/3liz/py-qgis-server/blob/master/pyqgisserver/qgsworker.py#L306) knowing that I use the default shceme (file)
But I just did some tests, this condition is never true state == UpdateState.UPDATED
It is true when a modified version of the project has been reloaded on a cache refresh.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
In the refresh_cache method https://github.com/3liz/py-qgis-server/blob/master/pyqgisserver/qgsworker.py#L299
cls. _cache_check_interval <= 0
the cache will be never refresh ?