Skip to content

Only allow one FTP operation at a time#941

Merged
1Blademaster merged 3 commits intomainfrom
920-only-allow-one-ftp-operation-at-once
Dec 31, 2025
Merged

Only allow one FTP operation at a time#941
1Blademaster merged 3 commits intomainfrom
920-only-allow-one-ftp-operation-at-once

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings December 31, 2025 08:55
@1Blademaster 1Blademaster linked an issue Dec 31, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a locking mechanism to prevent concurrent FTP operations by introducing a current_op field that tracks the currently executing operation. The implementation uses try-finally blocks to ensure the lock is always released, even when errors occur.

Key Changes:

  • Added current_op instance variable to track active FTP operations
  • Wrapped listFiles and readFile methods with try-finally blocks for automatic cleanup
  • Added comprehensive test coverage for blocking behavior and cleanup scenarios

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
radio/app/controllers/ftpController.py Implements operation locking mechanism with current_op tracking and try-finally cleanup in listFiles and readFile methods
radio/tests/test_ftpController.py Adds test coverage for concurrent operation blocking, error cleanup, and sequential operation execution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread radio/app/controllers/ftpController.py Outdated
Comment thread radio/app/controllers/ftpController.py Outdated
@1Blademaster 1Blademaster requested a review from a team December 31, 2025 09:30
Copy link
Copy Markdown
Contributor

@NexInfinite NexInfinite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@1Blademaster 1Blademaster merged commit 15c4c2a into main Dec 31, 2025
7 checks passed
@1Blademaster 1Blademaster deleted the 920-only-allow-one-ftp-operation-at-once branch December 31, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only allow one FTP operation at once

3 participants