Skip to content

Commit

Permalink
#135 fix cleanup of telethon session files (#139)
Browse files Browse the repository at this point in the history
* closes #135

* version bump
  • Loading branch information
msramalho committed Apr 16, 2024
1 parent cf8691b commit 7cfe1e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/auto_archiver/archivers/instagram_tbot_archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ def setup(self) -> None:

def cleanup(self) -> None:
logger.info(f"CLEANUP {self.name}.")
if os.path.exists(self.session_file):
os.remove(self.session_file)
session_file_name = self.session_file + ".session"
if os.path.exists(session_file_name):
os.remove(session_file_name)

def download(self, item: Metadata) -> Metadata:
url = item.get_url()
Expand Down
5 changes: 3 additions & 2 deletions src/auto_archiver/archivers/telethon_archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ def setup(self) -> None:

def cleanup(self) -> None:
logger.info(f"CLEANUP {self.name}.")
if os.path.exists(self.session_file):
os.remove(self.session_file)
session_file_name = self.session_file + ".session"
if os.path.exists(session_file_name):
os.remove(session_file_name)

def download(self, item: Metadata) -> Metadata:
"""
Expand Down
2 changes: 1 addition & 1 deletion src/auto_archiver/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
_MINOR = "11"
# On main and in a nightly release the patch should be one ahead of the last
# released build.
_PATCH = "2"
_PATCH = "3"
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
# https://semver.org/#is-v123-a-semantic-version for the semantics.
_SUFFIX = ""
Expand Down

0 comments on commit 7cfe1e3

Please sign in to comment.