Skip to content

Commit d891339

Browse files
committed
minor fix
1 parent 50d6f71 commit d891339

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tcf_website/management/commands/fetch_enrollment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# Maximum number of retry attempts
3131
MAX_TRIES = 8
3232
# Kept larger than MAX_WORKERS to handle connection lifecycle issues
33-
MAX_POOL_SIZE = 20 * 5
33+
MAX_POOL_SIZE = 5 * 5
3434

3535
# Thread-local storage for requests sessions to avoid contention
3636
_session_local = threading.local()

tcf_website/tests/test_enrollment.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tests for enrollment data updates."""
22

3+
import asyncio
34
from unittest.mock import patch
45

56
from django.test import TestCase
@@ -35,7 +36,7 @@ def test_mocked_update_enrollment_data(self, mock_fetch):
3536
"waitlist_taken": 5,
3637
"waitlist_limit": 10,
3738
}
38-
update_enrollment_data(self.section.course.id)
39+
asyncio.run(update_enrollment_data(self.section.course.id))
3940
self.enrollment.refresh_from_db()
4041
self.assertEqual(self.enrollment.enrollment_taken, 10)
4142
self.assertEqual(self.enrollment.enrollment_limit, 20)
@@ -44,7 +45,7 @@ def test_mocked_update_enrollment_data(self, mock_fetch):
4445

4546
def test_update_enrollment_data(self):
4647
"""Test enrollment data update with real data."""
47-
update_enrollment_data(self.section.course.id)
48+
asyncio.run(update_enrollment_data(self.section.course.id))
4849
self.enrollment.refresh_from_db()
4950
self.assertGreaterEqual(self.enrollment.enrollment_taken, 0)
5051
self.assertGreaterEqual(self.enrollment.enrollment_limit, 0)

0 commit comments

Comments
 (0)