Skip to content

Commit

Permalink
ci: update deps celery
Browse files Browse the repository at this point in the history
  • Loading branch information
Bidaya0 committed May 22, 2023
1 parent 90fff93 commit 02face6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dongtai_engine/plugins/data_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from asgiref.sync import sync_to_async
import asyncio
from typing import List, Tuple
import asyncio_gevent
#import asyncio_gevent

DELETE_BATCH_SIZE = 10000

Expand Down Expand Up @@ -84,7 +84,7 @@ def data_clean_batch(upper_id: int, lower_id: int):
qs._raw_delete(qs.db)


@asyncio_gevent.async_to_sync
#@asyncio_gevent.async_to_sync
async def loop_main(range_list: List[Tuple[int, int]]):
coros = [
data_clean_batch(upper_id, lower_id)
Expand All @@ -97,4 +97,5 @@ def batch_clean(upper_id: int, lower_id: int, batch_size: int):
chunk_range = list(
zip(range(lower_id + batch_size, upper_id + batch_size, batch_size),
range(lower_id, upper_id, batch_size)))
loop_main(chunk_range)
loop = asyncio.get_event_loop()
loop.run_until_complete(loop_main(chunk_range))

0 comments on commit 02face6

Please sign in to comment.