Skip to content

Commit

Permalink
feat(apis): run worker auto if api auto request true ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBrisorgueil committed Apr 17, 2020
1 parent 761bdc7 commit 43e46d1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions modules/apis/services/apis.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,8 @@ exports.getAggregateApi = async (api, body) => {
const result = await ApisRepository.getAggregateApi(api.slug, body);
// check if no data return, then we probably have no data :)
// ask for it !
if (result.length === 0) {
if (result.length === 0 && api.autoRequest) {
this.workerAuto(api, body, new Date());
console.log('worker auto start', body);
}
return Promise.resolve(result);
};

0 comments on commit 43e46d1

Please sign in to comment.