mirror of
https://github.com/xfarrow/blink
synced 2025-02-16 08:00:35 +01:00
Create osm_data_fetcher.js
This commit is contained in:
parent
5698e702af
commit
bb547e8911
17
backend/apis/nodejs/src/utils/osm_data_fetcher.js
Normal file
17
backend/apis/nodejs/src/utils/osm_data_fetcher.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
const OsmRateLimiter = {
|
||||||
|
lastFetchTime: 0,
|
||||||
|
|
||||||
|
canFetch: function () {
|
||||||
|
return Date.now() - this.lastFetchTime >= 1000;
|
||||||
|
},
|
||||||
|
|
||||||
|
updateFetchTime: function () {
|
||||||
|
this.lastFetchTime = Date.now();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function retrieveCitiesFullName(name){
|
||||||
|
if (!OsmRateLimiter.canFetch()) {
|
||||||
|
// todo
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user