alfem/telegram-download-daemon

Use messages as DB

Closed this issue · 2 comments

Currently we have some problems in the area of persistency.

The main problem is that if the daemon stopped without finishing its tasks, it will not continue them next time it loaded.

I think we can solve that somehow by reading the history of the messages when the daemon loading, then for each file, the daemon need to search all the replies of that message to get the latest status.

To reduce the amount of the message, we can update the status by editing the message, instead of replying new one.

What do you think?

alfem commented

Message history can be really long. I like the idea, but I would like to make this 'recovery' optional.

And we need to stick to a fixed and parseable message format in order to use this 'weird' DB. A future i18n will be hard, IMHO.

Other option could be plain text files as storage for download status. We can create a special file just with the pickled message, and delete them when a download finishes.

alfem commented

Probably solved when #52 is fixed and merged