goliatone / core.io-filesync Goto Github PK
View Code? Open in Web Editor NEWcore.io file sync utility
License: MIT License
core.io file sync utility
License: MIT License
We should throw error if we don't have a data-manager module available, right now the persistence module fails because we are locked waiting for data-manager here, in this module. In that situation, the error is not clear at all!
We use a filename to get the entities name, e.g. devices.json is mapped to Device
model.
In order to support multiple json file containing records, we could name files:
We would have to replace how we parse the entity name from the filename.
seed
:
entityFiles
: List of entity files to expect.exitIfMissingEntityFile
: default true. If we have defined seed.entityFiles
and one of those files is not found and exitIfMissingEntityFile is true then we throw an error.lib/filesync.js, add to #L-120
Filesync.DEFAULTS = {
exitIfMissingEntityFile: true,
...
};
If we are expecting an entity json file, and we can't access it or it doesnt exist, we want to exit if it's a critical error.
For instance, if we are booting up our application, and we expect a users.json
file with default users, with a needed user, we should fail if it's not there.
lib/filesync.js #L-97. This depends on #1.
.catch((err)=>{
let message = `filesync: seed file "${filepath}" error.`
return this.context.onErrorHandler(this.exitIfMissingEntityFile, message, err);
});
Refactor code to handle OTA semantics.
Check mqtt-ota
If we are using sails-mongodb the initial file sync does not trigger. This is due to not resolving datamanager
in the init routing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.