anthill / 6element

Optimising waste management in recycle centers.
http://weareants.fr/#!/6element
14 stars 13 forks source link

Add a cron job to query OSM daily #203

Closed bleucitron closed 8 years ago

bleucitron commented 8 years ago

We need not to forget about this. Currently, the code to query OSM every day is not set as a CRON job. So we basically never update ou OSM points. @vallettea, when you have a moment, we should address this.

vallettea commented 8 years ago

But I though it was done from the begining we have the following cron job on the server:

- name: Creates daily osm data loader
  cron: minute="00" hour="02"
        name="OSM_fetch"
        user="root"
        job="/bin/bash -c '. ~/.nvm/nvm.sh; cd /root/{{service_name}}; nvm use; node server/loadOSMtoDb.js'"

where can i check if the data is updated ?

bleucitron commented 8 years ago

Oops, i forgot you actually set up the CRON job... my bad, i should have closed the issue. We drop the osm_places in the process, so we can't use the timestamps to check if it's updated. But there are some console logs:

        console.log('Recycling points in OSM:', data.length);
        console.log('New points:', data.length - Object.keys(savedBins).length);
        console.log('Creating points in DB ...');

They should appear in the server logs.