Conversation
|
Ran this overnight to verify basic polling behavior (every 15 minutes). I'm not sure how often it happens, but it looks like the website was updated at around midnight. Email notifications didn't get sent out until after 9:30. Might be an interesting thing to track as we add more sites/states. |
3cfe789 to
e698c19
Compare
e698c19 to
197a9ab
Compare
197a9ab to
3b64852
Compare
| try: | ||
| self._poll_cycle(options, redis, courts, TAMESScraper) | ||
| except Exception: | ||
| logger.exception("Error during poll cycle") |
There was a problem hiding this comment.
We should log the exception as well especially if we're using an except clause this broad.
There was a problem hiding this comment.
logger.exception does this automatically (and should work with Sentry).
| options: dict[str, Any], | ||
| redis, | ||
| courts: list[str] | None, | ||
| scraper_class: type, |
There was a problem hiding this comment.
Are we planning to make this command more extensible or can we just use TAMESScraper and remove this parameter?
There was a problem hiding this comment.
I think I was probably fantasizing about this being reused, so you're right that this is a bit premature.
| RateLimitedRequestManager( | ||
| **search_rm_args | ||
| ) as search_request_manager, | ||
| RateLimitedRequestManager(**case_rm_args) as case_request_manager, |
There was a problem hiding this comment.
I think it's more clear to pass the kwargs directly here since we're not doing anything with the dictionaries.
e90f154 to
72778e4
Compare
|
Changed this to target #6978 which it depends upon for case subscription. |
2145f7b to
0e6024e
Compare
This comment has been minimized.
This comment has been minimized.
324c035 to
48a1fa7
Compare
99f001f to
937d210
Compare
albertisfu
left a comment
There was a problem hiding this comment.
Also, an integration test for tames_poller would be helpful here please. To cover the entire workflow, including cases when new cases are found, when none are found, and the ingestion of new cases into the DB.
I'll do a full review once tests are in place.
48a1fa7 to
7074eaa
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
6600891 to
9e82066
Compare
albertisfu
left a comment
There was a problem hiding this comment.
Thanks @Brennan-Chesley-FLP just a few additional suggestions, please.
cdc7142 to
ecfe646
Compare
ecfe646 to
804a642
Compare
albertisfu
left a comment
There was a problem hiding this comment.
Thanks for all the work here, @Brennan-Chesley-FLP. This is ready to go. I’ll notify the infra team to merge the PR and apply the migration when they’re ready.
Summary
This PR adds a polling command for new cases on TAMES. It looks at the first page of search results (going backwards in time from the current date) and if it doesn't match the last cached results, it backfills a configurable number of days or cases. After it has done this, it (will) merges the scraped dockets and subscribes to new cases.
Deployment
This PR should:
skip-deploy(skips everything below)skip-web-deployskip-celery-deployskip-cronjob-deployskip-daemon-deploy