Giter Site home page Giter Site logo

comuni-service's People

Contributors

juanramino avatar lucapalomba avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lucapalomba

comuni-service's Issues

Restart after Update strategy

I see that the command for updating data is:
cd /app/ && npm run update:comuni && pm2 restart comuni-service

So, each time the comuni was updated, the service stopped and restart.
In my opnion this is not the best way to do this, cause all the service flat out and reopen in memory all the Db, each time. Image this in a polling service. And if an error happen and the new file wasn't created? You cannot rollback or restart the service.

So i was thinking about using the --watch option for pm2.
Think about the procedure with this parameter. The comuni.json was update (my last PR) only if there is a true changing event. And the use of the watch parameter can drop the major part of useless "stop and start" procedure.

The problem is:
In this scenario, you should have a static name for the Json, cause the watch parameter do the best watching for a file or a folder. So i propose to change the Env variable name for the file JSON in a static one (comuni.json) for example, in order to accomplish all the strategies i wrote before.

What about?

Add foreign states

Add foreign states data:

  • Name
  • Italian province ('EE')
  • Italian code

It could be nice to find a public URL that show this data and update it ISTAT do with Italian municipality.

For now I find this data (attached)
foreign.json.txt

Not a real test

I see the comuniUpdater.js tests but, in my opinion these are not real tests. There are a few considerationts around this:

  • Test should be consistent. This is not true at the moment, cause if you check the updater flow, can pass or not in base of the ISTAT site reachable condition.
  • Test should be replicable. Is not true too cause jsonFile is conditional so you cannot run al the tests in the same moment.

What's your opinion?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.