| 35 | return 0 |
| 36 | |
| 37 | async def _add_pending(self, token_id: int, for_image_generation: bool, for_video_generation: bool): |
| 38 | async with self._pending_lock: |
| 39 | if for_image_generation: |
| 40 | self._image_pending[token_id] = max(0, int(self._image_pending.get(token_id, 0))) + 1 |
| 41 | elif for_video_generation: |
| 42 | self._video_pending[token_id] = max(0, int(self._video_pending.get(token_id, 0))) + 1 |
| 43 | |
| 44 | async def release_pending(self, token_id: int, for_image_generation: bool = False, for_video_generation: bool = False): |
| 45 | async with self._pending_lock: |