m-haisham/novelsave

[Bug] DB error

Closed this issue · 4 comments

I have noticed if i terminate program abruptly, in next run i face problems.
I have seen downloading from start & database size doubling.
Also totally not downloading giving JSONDecode Errors. DB errors. Most likely DB is not in same shape novel save expecting & resulting these errors.
I think there should be a tmp db during run & then it should be merged into main db after successful run. That way those errors can be avoided.

Using a temp db paired with atexit module is a good solution.

Im planning to for-go the current database (TinyDB), it doesnt provide the required speed, plus what you have pointed out.
Im currently debating between using just json files or a sql database. Im open to suggestions.

That would requite some work.

I think JSON would be good too. It would be faster & i don't see any need of using sqlite or mongodb unless some "full website rip+server to check update frequently" type application you are aiming.

Im going to implement a caching middleware into TinyDB and see how it goes

It didnt work out how i assumed it would. so the only remaining option is a database rewrite.