madec-project / ezvis

A dashboard to visualize a synthesis on a structured corpus, using several charts (pies, histograms, ...)
https://ezvis.readthedocs.org/
17 stars 5 forks source link

Optional use of castor-load ? #84

Open nojhamster opened 9 years ago

nojhamster commented 9 years ago

I tried to visualize data that was previously inserted in mongo by another mean, but castor-load requires a directory and throws an exception on startup. Then I commented all lines relative to the loader in castor-core, and as far as I tested it works like a charm.

That would be sweet to be able to turn off castor-load from the config file. The documentation needs some clarification as well : in this case, collectionName is mandatory, connectionURI is very likely to be required if the db name is not "castor", and port is optional and not related to mongo.

I might propose a PR if I find some time to work on it.

touv commented 9 years ago

the loader will be disabled if the path does not exist cf. https://github.com/castorjs/castor-core/blob/2.x/index.js#L166

nojhamster commented 9 years ago

Actually the problem is just above : the middlewares are not loaded, but an instance of castor-load is created anyway, and throws the exception. Since castor-load is not used in this case, maybe it shouldn't be created at all ?

touv commented 9 years ago

understood. but... it may be used elsewhere, i don't know

nojhamster commented 9 years ago

There are eventListeners binded to it here, here and here. Without those lines it seems to work fine without the loader, but I didn't perform deep testing, just clicked randomly on chart filters.