Maps icon indicating copy to clipboard operation
Maps copied to clipboard

`$egMapsGeoJsonCacheTtl` seems to have no effect

Open georgjaehnig opened this issue 1 year ago • 2 comments

Setup

  • Maps version: 10.0.0
  • MW version: 1.35.5
  • PHP version: 7.4.32
  • SMW version (if applicable):

Issue

I have set this var for 100 days (I assume it takes seconds)

$egMapsGeoJsonCacheTtl = 8640000;

But when I monitor the entries created in objectcache, they all get created with an expiration time of < 1 day:

> SELECT keyname, exptime  FROM objectcache ORDER BY keyname;

| xpw_dev:Maps\DataAccess\CachingGeocoder:                                      | 2023-01-22 17:37:54 |
| xpw_dev:Maps\DataAccess\CachingGeocoder:Aldi_Leipzig_Hbf_                     | 2023-01-22 17:39:45 |
| xpw_dev:Maps\DataAccess\CachingGeocoder:Alnatura_Leipzig_Hbf_                 | 2023-01-22 17:39:46 |
| xpw_dev:Maps\DataAccess\CachingGeocoder:Bahnhofsplatz_1_Nürnberg_             | 2023-01-22 17:38:18 |
| xpw_dev:Maps\DataAccess\CachingGeocoder:Lidl_Essen_Hauptbahnhof_              | 2023-01-22 17:37:54 |
| xpw_dev:Maps\DataAccess\CachingGeocoder:Lidl_Nürnberg_Bahnhofsplatz_          | 2023-01-22 17:38:18 |
| xpw_dev:Maps\DataAccess\CachingGeocoder:REWE_Frankfurt_Flughafen_             | 2023-01-22 17:38:50 |
| xpw_dev:Maps\DataAccess\CachingGeocoder:Rewe_Willy-Brandt-Platz_4_            | 2023-01-22 17:39:46 |
| xpw_dev:Maps\DataAccess\CachingGeocoder:SPAR_Express_Lieferservice_Frankfurt_ | 2023-01-22 17:38:51 |
| xpw_dev:Maps\DataAccess\CachingGeocoder:dm_Essen_Hauptbahnhof_                | 2023-01-22 17:37:54 |

I'd expect exptime to be somewhen end of April (100 days from now). Did I miss sth?

georgjaehnig avatar Jan 21 '23 17:01 georgjaehnig

Code looks correct:

https://github.com/ProfessionalWiki/Maps/blob/08a9a018a9a6b8d1d76c1cd64921d6dafc91ed85/src/MapsFactory.php#L147

https://github.com/JeroenDeDauw/SimpleCache/blob/master/src/Cache/MediaWikiCache.php#L44

Maybe whatever MediaWiki implementation of BagOfStuff is used does not respect the TTL parameter?

JeroenDeDauw avatar Jan 21 '23 18:01 JeroenDeDauw

Code looks correct:

It is calling newJeroenSimpleCacheFetcher which does not seem to appear anywhere else in the code. (Don't know if that's relevant.)

Besides, can verify in your objectcache table that the correct exptime is set?

Maybe whatever MediaWiki implementation of BagOfStuff is used does not respect the TTL parameter?

I don't know. How could I find out if 1.35.5 is doing this?

georgjaehnig avatar Jan 21 '23 18:01 georgjaehnig