Skip to content

Commit

Permalink
Do not close nested_event_loop in the Scheduler.__del__ (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdusek committed Jan 10, 2024
1 parent eea224c commit 0dc775c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@
### Internal changes

- Allowed running integration tests from PRs from forks, after maintainer approval
- Do not close `nested_event_loop` in the `Scheduler.__del__`.

## [1.5.0](../../releases/tag/v1.5.0) - 2024-01-03

Expand Down
10 changes: 0 additions & 10 deletions src/apify/scrapy/scheduler.py
Expand Up @@ -49,16 +49,6 @@ def open(self: ApifyScheduler, spider: Spider) -> None: # noqa: A003 # this has
traceback.print_exc()
raise

def close(self: ApifyScheduler, reason: str) -> None:
"""Close the scheduler.
Args:
reason: The reason for closing the scheduler.
"""
Actor.log.debug(f'ApifyScheduler.close was called (reason={reason})...')
nested_event_loop.stop()
nested_event_loop.close()

def has_pending_requests(self: ApifyScheduler) -> bool:
"""Check if the scheduler has any pending requests.
Expand Down

0 comments on commit 0dc775c

Please sign in to comment.