Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freeones scraper tweaks #509

Merged
merged 2 commits into from
May 4, 2020
Merged

Conversation

bnkai
Copy link
Collaborator

@bnkai bnkai commented Apr 29, 2020

Remove all regexp.MustCompile and logger.Fatal calls to make the scraper more predictable/consistent.
If a field is not valid skip it ( leave as nil) and continue to the next instead of exiting.
Add a default 30 45 sec timeout to http requests ( no images are fetched so it should be safe, might need some more tweaking)

@bnkai bnkai changed the title freeones scaper tweaks freeones scraper tweaks Apr 29, 2020
@WithoutPants
Copy link
Collaborator

MustCompile is used where the regex is static and known to be valid. There is no need to change any of the MustCompile calls, since they are all valid expressions.

@WithoutPants WithoutPants added this to the Version 0.2.0 milestone Apr 29, 2020
@bnkai
Copy link
Collaborator Author

bnkai commented Apr 30, 2020

I just didn't like the fact that MustCompile panics if something is wrong. In the specific cases that can only happen during development ( changing the regex ) or during a pkg version upgrade if the package is bugged.
Should i change them back ?

@WithoutPants
Copy link
Collaborator

IMO yes. I don't think changing these are necessary.

@WithoutPants WithoutPants merged commit 0b50e83 into stashapp:develop May 4, 2020
Tweeticoats pushed a commit to Tweeticoats/stash that referenced this pull request Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants