miku / metha

Command line OAI-PMH harvester and client with built-in cache.

Home Page:http://web.archive.org/web/20230324034632/https://lab.ub.uni-leipzig.de/en/metha/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

metha-sync should catch SIGINT

nichtich opened this issue · comments

Running metha-sync can take a long time. Aborting with Ctrl+C (SIGINT) should be possible to just keep what has been harvested so far. By now SIGINT will leave METHA_DIR in a corrupted state with temporary files instead of .gz files. Better catch SIGINT and finish zipping the files instead.

Thanks for the cue. This should be possible today.

We respond to SIGINT.

However, I added os.Kill in addition to os.Interrupt - in 0.2.40.

Thanks for quick reply! Your solution is not what I was looking for (a way to manually abort download without loosing the downloaded files) but it's a valid design choice to remove up everything when killed with Ctrl+C.

Now I understand: the temporary files should be kept, since there may be thousand of them gather over many hours (I remember some endpoints).

I added a -k flag to keep temporary files around in 0.2.41.