Skip to content

Commit

Permalink
fix(smc-output): close ftp sessions properly (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare authored Dec 11, 2023
1 parent 8dceed3 commit fc0d2d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions nowplaying/track/observers/smc_ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def track_started(self, track: Track):
ftp.storlines("STOR /dls/nowplaying.dls", dls)
ftp.storlines("STOR /dlplus/nowplaying.dls", dlplus)

ftp.quit()
ftp.close()

logger.info(
Expand Down
2 changes: 2 additions & 0 deletions tests/test_track_observer_smc_ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def test_track_started(mock_ftp, track_factory, show_factory):
"STOR /dlplus/nowplaying.dls",
ANY,
),
call.quit(),
call.close(),
]
)
Expand Down Expand Up @@ -75,6 +76,7 @@ def test_track_started(mock_ftp, track_factory, show_factory):
ANY,
),
call.storlines("STOR /dlplus/nowplaying.dls", ANY),
call.quit(),
call.close(),
]
)
Expand Down

0 comments on commit fc0d2d0

Please sign in to comment.