Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

mod_tile sets HTTP expiry in the past, if osm2pgsql delayed #1040

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 2 comments
Closed

Comments

@openstreetmap-trac
Copy link

Reporter: openstreetmap[at]firefishy.com
[Submitted to the original trac issue database at 5.28pm, Monday, 14th July 2008]

If the osm2pgsql import is delayed, mod_tile sets a tile HTTP expiry in the past.

Currently:

nextPlanet = (state == tileCurrent) ? (getPlanetTime(r) + apr_time_from_sec(PLANET_INTERVAL)) : r->request_time;
holdoff = apr_time_from_sec(3 * 60 * 60) * (rand() / (RAND_MAX + 1.0));
expires = nextPlanet + holdoff;

Sudo code fix:

nextPlanet = (state == tileCurrent AND (getPlanetTime(r) + apr_time_from_sec(PLANET_INTERVAL)) < r->request_time )) ? (getPlanetTime(r) + apr_time_from_sec(PLANET_INTERVAL)) : r->request_time;
holdoff = apr_time_from_sec(3 * 60 * 60) * (rand() / (RAND_MAX + 1.0));
expires = nextPlanet + holdoff;
@openstreetmap-trac
Copy link
Author

Author: jonb
[Added to the original trac issue at 9.19pm, Wednesday, 16th July 2008]

(In [9098]) mod_tile: Fix negative expiry times. Closes #1040

@openstreetmap-trac
Copy link
Author

Author: openstreetmap[at]firefishy.com
[Added to the original trac issue at 12.40am, Thursday, 24th July 2008]

correct bug title typo. pedantic=yes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant