Fix sitemap

Add 24 hour cache
Add jobs to sitemap
Possible warning about to many eventemitter listeners
This commit is contained in:
Berkeley Martinez
2016-04-07 13:00:51 -07:00
parent 4f957d1d80
commit b2462e1b4c
4 changed files with 89 additions and 143 deletions

View File

@@ -25,15 +25,20 @@ export function saveInstance(instance) {
// alias saveInstance
export const saveUser = saveInstance;
export function observeQuery(Model, method, query) {
return Rx.Observable.fromNodeCallback(Model[method], Model)(query);
// observeQuery(Model: Object, methodName: String, query: Any) => Observable
export function observeQuery(Model, methodName, query) {
return Rx.Observable.fromNodeCallback(Model[methodName], Model)(query);
}
// observeMethod(
// context: Object, methodName: String
// ) => (query: Any) => Observable
export function observeMethod(context, methodName) {
return Rx.Observable.fromNodeCallback(context[methodName], context);
}
// timeChache(amount: Number, unit: String) => Observable
// must be bound to an observable instance
// timeCache(amount: Number, unit: String) => Observable
export function timeCache(time, unit) {
const source = this;
let cache;