metha icon indicating copy to clipboard operation
metha copied to clipboard

metha-sync should catch SIGINT

Open nichtich opened this issue 2 years ago • 3 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.

nichtich avatar Jun 22 '23 05:06 nichtich

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.

miku avatar Jun 22 '23 07:06 miku

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.

nichtich avatar Jun 22 '23 10:06 nichtich

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.

miku avatar Jun 22 '23 10:06 miku