openstreetmap-ng
openstreetmap-ng copied to clipboard
Async trace compression
Fixes #100
- All previous compression functions were renamed to
precompressaccordingly. - After precompressing, a task is added using the
asyncio.create_taskfunction (notloop.run_in_executor). - This function compresses using level 22, then uploads to the database, overrides the previous database entry, and then deletes the previous file.
- If inserting the new file into the database fails, the new file is deleted so the old one remains.
- I have tested it regarding error handling, but it might not properly handle some edge cases.
Edit: I have no idea what causes segfault error in cython
Sent details on Discord, consider the bounty to be 15$ after the changes