Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // "METHODS"
- SearchUtils.prototype.run = function() {
- this.getScraperContainersListPromise()
- .then((containers) => {
- for (let i = 0; i < containers.length; i++) {
- if (containers[i].Names.toString().indexOf("scraper") !== -1) {
- this.addToScraperList(containers[i].Id, "wait");
- }
- }
- }, (err)=>{console.log(err)})
- .then(()=>{
- return this.checkReadyScraper();
- },(err)=>{console.log(err)})
- .then(() => {
- this.scrap();
- }, (err)=>{console.log(err)});
- };
- SearchUtils.prototype.checkReadyScraper = function() {
- return new Promise ((resolve, reject)=>{
- for (let i = 0; i < this.scraperListId.length; i++) {
- this.exec("getStatus", this.scraperListId[i].id);
- }
- resolve();
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement