mirror of
https://github.com/openstreetmap/mod_tile.git
synced 2025-08-03 07:49:53 +00:00
Partially revert previous commit for logging and fix it.
The previous patch did not take different storage backends into account, or different tile path locations.
This commit is contained in:
16
daemon.c
16
daemon.c
@ -80,20 +80,6 @@ void send_response(struct item *item, enum protoCmd rsp, int render_time) {
|
||||
}
|
||||
}
|
||||
|
||||
void item_load(struct item *item, const struct protocol *req) {
|
||||
char path[PATH_MAX];
|
||||
struct stat buf;
|
||||
xyz_to_meta(path, sizeof(path), HASH_PATH, req->xmlname, req->x, req->y, req->z);
|
||||
if(!stat(path, &buf)) {
|
||||
// save time of old tile
|
||||
item->old_mtime=buf.st_mtime;
|
||||
}
|
||||
else {
|
||||
// no tile
|
||||
item->old_mtime=0;
|
||||
}
|
||||
}
|
||||
|
||||
enum protoCmd rx_request(const struct protocol *req, int fd)
|
||||
{
|
||||
struct protocol *reqnew;
|
||||
@ -128,8 +114,6 @@ enum protoCmd rx_request(const struct protocol *req, int fd)
|
||||
item->duplicates = NULL;
|
||||
item->fd = (req->cmd == cmdDirty) ? FD_INVALID : fd;
|
||||
|
||||
item_load(item, req);
|
||||
|
||||
#ifdef METATILE
|
||||
/* Round down request co-ordinates to the neareast N (should be a power of 2)
|
||||
* Note: request path is no longer consistent but this will be recalculated
|
||||
|
12
gen_tile.cpp
12
gen_tile.cpp
@ -587,13 +587,15 @@ void *render_thread(void * arg)
|
||||
gettimeofday(&tim, NULL);
|
||||
long t1=tim.tv_sec*1000+(tim.tv_usec/1000);
|
||||
|
||||
if(item->old_mtime==0)
|
||||
struct stat_info sinfo = maps[i].store->tile_stat(maps[i].store, req->xmlname, item->mx, item->my, req->z);
|
||||
|
||||
if(sinfo.size > 0)
|
||||
syslog(LOG_DEBUG, "DEBUG: START TILE %s %d %d-%d %d-%d, age %.2f days",
|
||||
req->xmlname, req->z, item->mx, item->mx+size-1, item->my, item->my+size-1,
|
||||
(tim.tv_sec-sinfo.mtime)/86400.0);
|
||||
else
|
||||
syslog(LOG_DEBUG, "DEBUG: START TILE %s %d %d-%d %d-%d, new metatile",
|
||||
req->xmlname, req->z, item->mx, item->mx+size-1, item->my, item->my+size-1);
|
||||
else
|
||||
syslog(LOG_DEBUG, "DEBUG: START TILE %s %d %d-%d %d-%d, age %.3f days",
|
||||
req->xmlname, req->z, item->mx, item->mx+size-1, item->my, item->my+size-1,
|
||||
(tim.tv_sec-item->old_mtime)/86400.0);
|
||||
|
||||
ret = render(&(maps[i]), item->mx, item->my, req->z, tiles);
|
||||
|
||||
|
@ -20,7 +20,6 @@ struct item {
|
||||
int fd;
|
||||
struct item *duplicates;
|
||||
enum queueEnum inQueue;
|
||||
time_t old_mtime;
|
||||
};
|
||||
|
||||
//int render(Map &m, int x, int y, int z, const char *filename);
|
||||
|
Reference in New Issue
Block a user