Skip to content

Commit

Permalink
fix job_temp_cleaning script to await futures
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult committed Jun 3, 2024
1 parent 7c7a4d1 commit 335fc1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/wipac-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ jobs:
runs-on: ubuntu-latest
services:
mongo:
image: mongo:4.0
image: mongo:7.0
ports:
- 27017:27017
env:
TEST_DATABASE_URL: "localhost:27017"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -79,7 +77,7 @@ jobs:
pip install .[tests]
- name: Run Tests
run: |
coverage run --source iceprod,bin --parallel-mode --branch -m pytest --tb=short tests
coverage run --source iceprod,bin --parallel-mode --branch -m pytest --tb=short --log-level=info tests
- name: Coverage report
if: always() && steps.dependencies.outcome != 'failure'
run: |
Expand Down
4 changes: 2 additions & 2 deletions iceprod/scheduled_tasks/job_temp_cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async def run(rest_client, temp_dir, list_dirs, rmtree, dataset=None, debug=Fals
if int(j) in job_indexes:
while len(futures) >= 16:
done, futures = await asyncio.wait(futures, return_when=asyncio.FIRST_COMPLETED)
for f in futures:
for f in done:
try:
await f
except Exception:
Expand All @@ -152,7 +152,7 @@ async def run(rest_client, temp_dir, list_dirs, rmtree, dataset=None, debug=Fals

while futures:
done, futures = await asyncio.wait(futures, return_when=asyncio.FIRST_COMPLETED)
for f in futures:
for f in done:
try:
await f
except Exception:
Expand Down

0 comments on commit 335fc1c

Please sign in to comment.