collab-uniba / pynblint

Pynblint is a linter for Python Jupyter notebooks.
MIT License
40 stars 2 forks source link

[API] Handle concurrent requests #44

Closed louieQ closed 3 years ago

louieQ commented 3 years ago

At present, the API does not handle concurrent requests. If a couple of concurrent requests arrive and, for instance, they both request the analysis of two different notebooks named Untitled.ipynb, then the API crashes or its responses are unreliable.

Tho handle this problem, one idea might be to dedicate a temporary folder to each new incoming request. This temporary folder might be named upon the current timestamp, with milliseconds precision.

Then, notebooks might be saved using their hash / sumcheck as filenames. On the other hand, the original filename might be stored as an attribute of the corresponding Notebook object and returned by the API as it happens now.

RomitoVincenzo commented 3 years ago

resolved with tempfile library