Skip to content

Commit

Permalink
Fix page proxy
Browse files Browse the repository at this point in the history
An attempt to work around Cuadrix/puppeteer-page-proxy#76
  • Loading branch information
21jake committed Mar 8, 2023
1 parent 1865a2a commit 31d3c71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions backend/src/services/scraper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,15 @@ export class ScraperService {
keywordRecord.error = error.message;
}

try {
await page.close();
} catch (error) {
console.log(`Error closing page: ${error.message}`);
}

const saved = await this.keywordRepository.save(keywordRecord);
console.log({ savedKeword: saved });

await sleep(1000);
await page.close();

}
}
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- TZ=Asia/Ho_Chi_Minh
- POSTGRESQL_TIMEZONE=Asia/Ho_Chi_Minh
backend:
image: jake21/scraper-backend
image: jake21/scraper-backend:exp
env_file:
- ./backend/.env.dev
ports:
Expand Down

0 comments on commit 31d3c71

Please sign in to comment.