Fix unit of measure for lastUpdated info extraction

This commit is contained in:
Sandro Santilli 2013-05-30 16:48:40 +02:00
parent 92a3d52885
commit 5b6919e0c6
2 changed files with 6 additions and 2 deletions

View File

@ -83,6 +83,10 @@ module.exports = function(){
});
};
//
// Invoke callback with number of milliseconds since
// last update in any of the given tables
//
me.findLastUpdated = function (username, api_key, tableNames, callback) {
var sql = 'SELECT EXTRACT(EPOCH FROM max(updated_at)) as max FROM CDB_TableMetadata m WHERE m.tabname::name = any (\'{'
+ tableNames.join(',') + '}\')';
@ -99,7 +103,7 @@ module.exports = function(){
if(rows.length !== 0) {
last_updated = rows[0].max || 0;
}
callback(null, last_updated);
callback(null, last_updated*1000);
});
};

View File

@ -14,7 +14,7 @@ var o = function(port, cb) {
} else if ( query.q.match('EPOCH.* as max') ) {
// This is the structure of the known query sent by tiler
var row = {
'max': 1234567890123
'max': 1234567890.123
};
res.write(JSON.stringify({rows: [ row ]}));
} else {