fix: re-add sync target to Makefile all and fix asyncio loop reference in get_recent_rants

The Makefile's `all` target was missing the `sync` step, which has now been restored alongside a fix in `src/drstats/sync.py` where `asyncio.wait_for` incorrectly called `asyncio.run_in_executor` instead of the proper `loop.run_in_executor` to avoid event loop context errors during async execution.
This commit is contained in:
retoor 2024-11-25 19:44:33 +00:00
parent a6fd640e92
commit 2f3a4431b6
3 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
all: build sync_excempt export_dataset export_stats merge_images export_statistics export_mentions
all: build sync export_dataset export_stats merge_images export_statistics export_mentions
build:
pip install build

Binary file not shown.

View File

@ -32,7 +32,7 @@ async def get_recent_rants(start_from=1, page_size=10):
def get_rants():
return dr.get_rants("recent", page_size, start_from)["rants"]
rants = asyncio.wait_for(asyncio.run_in_executor(get_rants), 5)
rants = asyncio.wait_for(loop.run_in_executor(get_rants), 5)
page += 1
for rant in rants: