You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All keywords are processed in a loop. If any error occurs in the loop, the latter will stop, and all remaining keywords will not be scraped and will not even have been saved to the database. A queue (supported by Nest.JS, see: https://docs.nestjs.com/techniques/queues) would be a better fit in this case.
Warning
Using the observer pattern can be beneficial when there is more than one subscriber/consumer. Since the event is consumed in the same module as it is emitted, it creates indirection unnecessarily.
Expected
Keywords should be stored in the database with a flag to track the scraping status as soon as they are uploaded
A distinct background job to scrap the Google page for each keyword is then scheduled.
The benefits are:
Fast CSV upload request
The scraping of each keyword is isolated, i.e., one could error while others could be successful.
The text was updated successfully, but these errors were encountered:
Issue
Upon uploading keywords, the scraping will be performed asynchronously via an event listener
google-searcher/src/search/listeners/search.listener.ts
Lines 17 to 27 in 36a95d4
All keywords are processed in a loop. If any error occurs in the loop, the latter will stop, and all remaining keywords will not be scraped and will not even have been saved to the database. A queue (supported by Nest.JS, see: https://docs.nestjs.com/techniques/queues) would be a better fit in this case.
Warning
Using the observer pattern can be beneficial when there is more than one subscriber/consumer. Since the event is consumed in the same module as it is emitted, it creates indirection unnecessarily.
Expected
The benefits are:
The text was updated successfully, but these errors were encountered: