deepghs / waifuc

Efficient Train Data Collector for Anime Waifu
https://deepghs.github.io/waifuc/
MIT License
290 stars 24 forks source link

dev(narugo): add rate limiter #28

Closed narugo1992 closed 10 months ago

narugo1992 commented 10 months ago

using pyrate-limiter, for issue #22, #27

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (6ffed73) 65.75% compared to head (88340bf) 65.94%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #28 +/- ## ========================================== + Coverage 65.75% 65.94% +0.18% ========================================== Files 44 44 Lines 2158 2170 +12 ========================================== + Hits 1419 1431 +12 Misses 739 739 ``` | [Flag](https://app.codecov.io/gh/deepghs/waifuc/pull/28/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=deepghs) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/deepghs/waifuc/pull/28/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=deepghs) | `65.94% <100.00%> (+0.18%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=deepghs#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

narugo1992 commented 10 months ago

1 img/sec rate limit is added, cc @nonamethanks

btw, this is the unittest: https://github.com/deepghs/waifuc/actions/runs/7406156268/job/20150166961

the rate is limited in class level, not instance level

the user cannot workaround this limit by creating multiple threads or source instances