Skip to content

Commit

Permalink
fix(uncurl): add close-handler to uncurl
Browse files Browse the repository at this point in the history
This commit adds a close-handler to the
uncurl annex remote. The handler closes
all open `url_operations-instances`. This
terminates all `shell`-related threads
and allows the uncurl-process to exit.
  • Loading branch information
christian-monch committed Jun 18, 2024
1 parent 742c468 commit d0e28c1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions datalad_next/annexremotes/uncurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@
$ git annex addurl http://httpbin.org/basic-auth/myuser/mypassword
Credential needed for access to http://httpbin.org/basic-auth/myuser/mypassword
user: myuser
password:
password (repeat):
password:
password (repeat):
Enter a name to save the credential
(for accessing http://httpbin.org/basic-auth/myuser/mypassword) securely for future
reuse, or 'skip' to not save the credential
name: httpbin-dummy
addurl http://httpbin.org/basic-auth/myuser/mypassword (from uncurl) (to ...)
addurl http://httpbin.org/basic-auth/myuser/mypassword (from uncurl) (to ...)
ok
(recording state in git...)
Expand Down Expand Up @@ -258,6 +258,14 @@ def __init__(self, annex: Master):
# or across annex keys
self.persistent_tmpl_props: dict[str, str] = {}

def __del__(self):
self.close()

def close(self) -> None:
if self.url_handler:
del self.url_handler
self.url_handler = None

def initremote(self) -> None:
# at present there is nothing that needs to be done on init/enable.
# the remote is designed to work without any specific setup too
Expand Down

0 comments on commit d0e28c1

Please sign in to comment.