Skip to content

Commit

Permalink
Disable the cache view by default
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Sep 25, 2024
1 parent 758fc00 commit af36476
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
12 changes: 12 additions & 0 deletions doc/developer/debugging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ To be automatically logged in with a user present in the database you should set
Then you will directly be logged in to the user.

C2C WSGI Utils tools
--------------------

:ref:`integrator_c2cwsgiutils` offers some debugging tools on the URL ``/c2c``.

Cache
-----

There a view that expose the cache status of the application, to be able to access to this view you should
set the environment variable ``GEOMAPFISH_DEBUG_MEMORY_CACHE`` to ``true``.

Then you can access the cache status through the :ref:`integrator_c2cwsgiutils` ``/c2c`` URL.

Mapserver
---------
Expand Down
2 changes: 1 addition & 1 deletion doc/integrator/c2cwsgiutils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ C2C WSGI Utils

``c2cwsgiutils`` is a framework assisting in development, integration and administration of WSGI applications.
``c2cgeoportal`` uses ``c2cwsgiutils``.
See its `documentation <https://github.com/camptocamp/c2cwsgiutils/#camptocamp-wsgi-utilities>`__.
See its `documentation <https://github.com/camptocamp/c2cwsgiutils/#camptocamp-wsgi-utilities>`_.

The entry point URL is ``<application main URL>/c2c``, where you will have a dashboard with the
``c2cwsgiutils`` and ``c2cgeoportal`` services.
Expand Down
9 changes: 5 additions & 4 deletions geoportal/c2cgeoportal_geoportal/views/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@


import logging
import os
import time
from typing import Any, cast

Expand Down Expand Up @@ -83,7 +84,7 @@ def _process_dict(dict_: dict[str, Any], dogpile_cache: bool = False) -> dict[st

@broadcast.decorator(expect_answers=True, timeout=110)
def _memory() -> dict[str, Any]:
return {
"raster_data": _process_dict(raster.Raster.data),
"memory_cache": _process_dict(MEMORY_CACHE_DICT, True),
}
result = {"raster_data": _process_dict(raster.Raster.data)}
if os.environ.get("GEOMAPFISH_DEBUG_MEMORY_CACHE", "false").lower() in ("true", "1", "yes", "on"):
result["memory_cache"] = _process_dict(MEMORY_CACHE_DICT, True)
return result

0 comments on commit af36476

Please sign in to comment.